farm-react 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,69 +1,4 @@
1
- # React + TypeScript + Vite
1
+ # publish-packages for (React Package, Node JS, Nest JS)
2
+ This is Demo Repo to showcase publishing packages related to Node JS, React UI & Nest JS Packages
2
3
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config([
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- extends: [
20
- // Other configs...
21
-
22
- // Remove tseslint.configs.recommended and replace with this
23
- ...tseslint.configs.recommendedTypeChecked,
24
- // Alternatively, use this for stricter rules
25
- ...tseslint.configs.strictTypeChecked,
26
- // Optionally, add this for stylistic rules
27
- ...tseslint.configs.stylisticTypeChecked,
28
-
29
- // Other configs...
30
- ],
31
- languageOptions: {
32
- parserOptions: {
33
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
- tsconfigRootDir: import.meta.dirname,
35
- },
36
- // other options...
37
- },
38
- },
39
- ])
40
- ```
41
-
42
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43
-
44
- ```js
45
- // eslint.config.js
46
- import reactX from 'eslint-plugin-react-x'
47
- import reactDom from 'eslint-plugin-react-dom'
48
-
49
- export default tseslint.config([
50
- globalIgnores(['dist']),
51
- {
52
- files: ['**/*.{ts,tsx}'],
53
- extends: [
54
- // Other configs...
55
- // Enable lint rules for React
56
- reactX.configs['recommended-typescript'],
57
- // Enable lint rules for React DOM
58
- reactDom.configs.recommended,
59
- ],
60
- languageOptions: {
61
- parserOptions: {
62
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
63
- tsconfigRootDir: import.meta.dirname,
64
- },
65
- // other options...
66
- },
67
- },
68
- ])
69
- ```
4
+ ![](https://i.ytimg.com/vi/lVze5eT5DQQ/maxresdefault.jpg)
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type props = {
3
+ value?: number;
4
+ };
5
+ declare const MyCounter: ({ value }: props) => React.JSX.Element;
6
+ export default MyCounter;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var react_1 = tslib_1.__importStar(require("react"));
5
+ var MyCounter = function (_a) {
6
+ var _b = _a.value, value = _b === void 0 ? 0 : _b;
7
+ var _c = (0, react_1.useState)(value), counter = _c[0], setCounter = _c[1];
8
+ var onMinus = function () {
9
+ setCounter(function (val) { return val - 1; });
10
+ };
11
+ var onPlus = function () {
12
+ setCounter(function (prev) { return prev + 1; });
13
+ };
14
+ return (react_1.default.createElement("div", null,
15
+ react_1.default.createElement("h1", null,
16
+ "Counter: ",
17
+ counter),
18
+ react_1.default.createElement("button", { onClick: onMinus }, "-"),
19
+ react_1.default.createElement("button", { onClick: onPlus }, "+")));
20
+ };
21
+ exports.default = MyCounter;
22
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":";;;AAAA,qDAAuC;AAMvC,IAAM,SAAS,GAAG,UAAC,EAAoB;QAAlB,aAAS,EAAT,KAAK,mBAAG,CAAC,KAAA;IACtB,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAA;IAE7C,IAAM,OAAO,GAAG;QACd,UAAU,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,GAAG,CAAC,EAAP,CAAO,CAAC,CAAA;IAC9B,CAAC,CAAA;IACD,IAAM,MAAM,GAAG;QACb,UAAU,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,GAAG,CAAC,EAAR,CAAQ,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,OAAO,CACL;QACE;;YAAc,OAAO,CAAM;QAC3B,0CAAQ,OAAO,EAAE,OAAO,QAAY;QACpC,0CAAQ,OAAO,EAAE,MAAM,QAAY,CAC/B,CACP,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ import MyCounter from './components/app';
2
+ export { MyCounter };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MyCounter = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var app_1 = tslib_1.__importDefault(require("./components/app"));
6
+ exports.MyCounter = app_1.default;
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAwC;AAE/B,oBAFF,aAAS,CAEE"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type props = {
3
+ value?: number;
4
+ };
5
+ declare const MyCounter: ({ value }: props) => React.JSX.Element;
6
+ export default MyCounter;
@@ -0,0 +1,19 @@
1
+ import React, { useState } from 'react';
2
+ var MyCounter = function (_a) {
3
+ var _b = _a.value, value = _b === void 0 ? 0 : _b;
4
+ var _c = useState(value), counter = _c[0], setCounter = _c[1];
5
+ var onMinus = function () {
6
+ setCounter(function (val) { return val - 1; });
7
+ };
8
+ var onPlus = function () {
9
+ setCounter(function (prev) { return prev + 1; });
10
+ };
11
+ return (React.createElement("div", null,
12
+ React.createElement("h1", null,
13
+ "Counter: ",
14
+ counter),
15
+ React.createElement("button", { onClick: onMinus }, "-"),
16
+ React.createElement("button", { onClick: onPlus }, "+")));
17
+ };
18
+ export default MyCounter;
19
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAMvC,IAAM,SAAS,GAAG,UAAC,EAAoB;QAAlB,aAAS,EAAT,KAAK,mBAAG,CAAC,KAAA;IACtB,IAAA,KAAwB,QAAQ,CAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAA;IAE7C,IAAM,OAAO,GAAG;QACd,UAAU,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,GAAG,CAAC,EAAP,CAAO,CAAC,CAAA;IAC9B,CAAC,CAAA;IACD,IAAM,MAAM,GAAG;QACb,UAAU,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,GAAG,CAAC,EAAR,CAAQ,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,OAAO,CACL;QACE;;YAAc,OAAO,CAAM;QAC3B,gCAAQ,OAAO,EAAE,OAAO,QAAY;QACpC,gCAAQ,OAAO,EAAE,MAAM,QAAY,CAC/B,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ import MyCounter from './components/app';
2
+ export { MyCounter };
@@ -0,0 +1,3 @@
1
+ import MyCounter from './components/app';
2
+ export { MyCounter };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,49 +1,53 @@
1
1
  {
2
2
  "name": "farm-react",
3
- "version": "1.0.3",
4
- "main": "dist/index.umd.js",
5
- "module": "dist/index.es.js",
6
- "types": "dist/index.d.ts",
7
- "type": "module",
8
- "files": [
9
- "dist"
10
- ],
11
- "preDependencies": {
12
- "react": "^19.1.1",
13
- "react-dom": "^19.1.1"
3
+ "version": "1.0.5",
4
+ "description": "",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "scripts": {
9
+ "prepare": "npm run build",
10
+ "prepublishOnly": "npm run test && npm run prettier && npm run lint",
11
+ "build": "npm run build:esm && npm run build:cjs",
12
+ "build:esm": "tsc",
13
+ "build:cjs": "tsc --module commonjs --outDir dist/cjs",
14
+ "test": "jest --config jestconfig.json",
15
+ "lint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\"",
16
+ "prettier": "prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\""
14
17
  },
15
- "dependencies": {
16
- "@types/node": "^24.3.0",
17
- "bootstrap": "5.3.7",
18
- "react": "^19.1.1",
19
- "react-bootstrap": "^2.10.10",
20
- "react-dom": "^19.1.1",
21
- "react-router": "^7.8.1",
22
- "scss": "^0.2.4"
18
+ "peerDependencies": {
19
+ "react": ">=16"
23
20
  },
21
+ "author": "",
22
+ "license": "ISC",
23
+ "files": [
24
+ "dist",
25
+ "LICENSE",
26
+ "README.md"
27
+ ],
28
+ "keywords": [
29
+ "react",
30
+ "typescript",
31
+ "awesome-project"
32
+ ],
24
33
  "devDependencies": {
25
- "@eslint/js": "^9.33.0",
26
- "@rollup/plugin-commonjs": "^28.0.6",
27
- "@rollup/plugin-node-resolve": "^16.0.1",
28
- "@rollup/plugin-typescript": "^12.1.4",
29
- "@types/react": "^19.1.10",
30
- "@types/react-dom": "^19.1.7",
31
- "@vitejs/plugin-react": "^5.0.0",
32
- "eslint": "^9.33.0",
33
- "eslint-plugin-react-hooks": "^5.2.0",
34
- "eslint-plugin-react-refresh": "^0.4.20",
35
- "globals": "^16.3.0",
36
- "rollup": "^4.46.2",
37
- "rollup-plugin-peer-deps-external": "^2.2.4",
38
- "sass-embedded": "^1.90.0",
39
- "typescript": "~5.8.3",
40
- "typescript-eslint": "^8.39.1",
41
- "vite": "^7.1.2",
42
- "vite-plugin-dts": "^4.5.4"
43
- },
44
- "scripts": {
45
- "dev": "vite",
46
- "build": "vite build",
47
- "preview": "vite preview"
34
+ "@testing-library/react": "^16.0.0",
35
+ "@types/jest": "^29.5.12",
36
+ "@types/react": "^18.3.3",
37
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
38
+ "@typescript-eslint/parser": "^7.15.0",
39
+ "eslint": "^8.57.0",
40
+ "eslint-config-prettier": "^9.1.0",
41
+ "eslint-plugin-prettier": "^5.1.3",
42
+ "eslint-plugin-react": "^7.34.3",
43
+ "eslint-plugin-react-hooks": "^4.6.2",
44
+ "jest": "^29.7.0",
45
+ "jest-canvas-mock": "^2.5.2",
46
+ "jest-environment-jsdom": "^29.7.0",
47
+ "prettier": "^3.3.2",
48
+ "react": "^18.3.1",
49
+ "react-dom": "^18.3.1",
50
+ "ts-jest": "^29.1.5",
51
+ "typescript": "^5.5.3"
48
52
  }
49
- }
53
+ }