diff --git a/apps/site/package.json b/apps/site/package.json index 5d59740ae6221..382e1ea60118a 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -38,6 +38,7 @@ "dependencies": { "@heroicons/react": "~2.1.5", "@mdx-js/mdx": "^3.0.1", + "@node-core/ui-components": "*", "@node-core/website-i18n": "*", "@nodevu/core": "~0.1.0", "@orama/highlight": "^0.1.6", diff --git a/package-lock.json b/package-lock.json index 22977e34ec1fd..866217ac1b2a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,6 +36,7 @@ "dependencies": { "@heroicons/react": "~2.1.5", "@mdx-js/mdx": "^3.0.1", + "@node-core/ui-components": "*", "@node-core/website-i18n": "*", "@nodevu/core": "~0.1.0", "@orama/highlight": "^0.1.6", @@ -4711,6 +4712,10 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@node-core/ui-components": { + "resolved": "packages/ui-components", + "link": true + }, "node_modules/@node-core/website": { "resolved": "apps/site", "link": true @@ -8671,6 +8676,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", "devOptional": true, + "license": "MIT", "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -13719,9 +13725,9 @@ "license": "ISC" }, "node_modules/eslint-plugin-react": { - "version": "7.37.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.1.tgz", - "integrity": "sha512-xwTnwDqzbDRA8uJ7BMxPs/EXRB3i8ZfnOIp8BsxEQkT0nHPp+WWceqGgo6rKb9ctNi8GJLDT4Go5HAWELa/WMg==", + "version": "7.37.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz", + "integrity": "sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==", "dev": true, "license": "MIT", "dependencies": { @@ -13730,7 +13736,7 @@ "array.prototype.flatmap": "^1.3.2", "array.prototype.tosorted": "^1.1.4", "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.19", + "es-iterator-helpers": "^1.1.0", "estraverse": "^5.3.0", "hasown": "^2.0.2", "jsx-ast-utils": "^2.4.1 || ^3.0.0", @@ -21615,16 +21621,6 @@ "dev": true, "license": "MIT" }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -29986,6 +29982,20 @@ "engines": { "node": ">=20" } + }, + "packages/ui-components": { + "name": "@node-core/ui-components", + "dependencies": { + "react": "^18.3.1" + }, + "devDependencies": { + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "eslint-import-resolver-typescript": "~3.6.3", + "eslint-plugin-react": "~7.37.1", + "typescript": "~5.6.3", + "typescript-eslint": "~8.8.1" + } } } } diff --git a/packages/ui-components/eslint.config.js b/packages/ui-components/eslint.config.js new file mode 100644 index 0000000000000..593e31df71fc8 --- /dev/null +++ b/packages/ui-components/eslint.config.js @@ -0,0 +1,20 @@ +import importX from 'eslint-plugin-import-x'; +import reactPlugin from 'eslint-plugin-react'; +import tseslint from 'typescript-eslint'; + +// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths +import baseConfig from '../../eslint.config.js'; + +export default [ + ...baseConfig, + ...tseslint.configs.recommended, + importX.flatConfigs.typescript, + reactPlugin.configs.flat.recommended, + reactPlugin.configs.flat['jsx-runtime'], + { + rules: { + '@typescript-eslint/array-type': ['error', { default: 'generic' }], + '@typescript-eslint/consistent-type-imports': 'error', + }, + }, +]; diff --git a/packages/ui-components/lib/button.tsx b/packages/ui-components/lib/button.tsx new file mode 100644 index 0000000000000..beebf6464ec5a --- /dev/null +++ b/packages/ui-components/lib/button.tsx @@ -0,0 +1,7 @@ +'use client'; + +import { PropsWithChildren } from 'react'; + +export default function Button({ children }: PropsWithChildren) { + return ; +} diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json new file mode 100644 index 0000000000000..ee1d536b2e078 --- /dev/null +++ b/packages/ui-components/package.json @@ -0,0 +1,21 @@ +{ + "name": "@node-core/ui-components", + "type": "module", + "exports": { + "./button": "./lib/button.tsx" + }, + "scripts": { + "lint:js": "eslint \"**/*.{js,mjs,ts}\"" + }, + "dependencies": { + "react": "^18.3.1" + }, + "devDependencies": { + "@types/react-dom": "^18.3.1", + "@types/react": "^18.3.12", + "eslint-import-resolver-typescript": "~3.6.3", + "eslint-plugin-react": "~7.37.1", + "typescript-eslint": "~8.8.1", + "typescript": "~5.6.3" + } +} diff --git a/packages/ui-components/tsconfig.json b/packages/ui-components/tsconfig.json new file mode 100644 index 0000000000000..fee9ebddc3c87 --- /dev/null +++ b/packages/ui-components/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "incremental": false, + "isolatedModules": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "module": "NodeNext", + "moduleDetection": "force", + "moduleResolution": "NodeNext", + "noUncheckedIndexedAccess": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "target": "ES2022", + "jsx": "react-jsx" + }, + "include": ["lib"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/ui-components/turbo.json b/packages/ui-components/turbo.json new file mode 100644 index 0000000000000..e7bc2973cfe0a --- /dev/null +++ b/packages/ui-components/turbo.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://turbo.build/schema.json", + "extends": ["//"], + "tasks": { + "lint:js": { + "inputs": ["lib/**/*.{js,mjs,ts}"] + } + } +}