@xwadex/fesd-next 0.3.1 → 0.3.2

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 ADDED
@@ -0,0 +1,26 @@
1
+ # your-ui-package
2
+
3
+ React UI 元件套件。
4
+
5
+ ## 安裝
6
+
7
+ ```bash
8
+ npm install your-ui-package
9
+ ```
10
+
11
+ ## 使用
12
+
13
+ ```tsx
14
+ import { MyComponent } from 'your-ui-package';
15
+
16
+ export default function App() {
17
+ return <MyComponent />;
18
+ }
19
+ ```
20
+
21
+ ## 內容
22
+
23
+ - `MyComponent`:簡單的 React 元件
24
+ - `useHooks`:自訂 hook
25
+ - `someUtil`:工具函式
26
+ - 共用型別
@@ -0,0 +1 @@
1
+ export declare const MyComponent: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from './MyComponent.module.scss';
3
+ export const MyComponent = () => (_jsx("div", { className: styles.container, children: "Hello World" }));
@@ -0,0 +1,3 @@
1
+ .container {
2
+ color: red;
3
+ }
@@ -0,0 +1 @@
1
+ export declare const useHooks: () => string;
@@ -0,0 +1,3 @@
1
+ export const useHooks = () => {
2
+ return 'This is a hook placeholder';
3
+ };
@@ -0,0 +1,4 @@
1
+ export * from './components/myComponents/MyComponent';
2
+ export * from './hooks/useHooks';
3
+ export * from './utils/someUtil';
4
+ export * from './types/common';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
- import { usePrevious as usePrevState } from './hooks/usePrevState';
2
- import { Demo } from './components/Demo';
3
- export { usePrevState, Demo };
1
+ export * from './components/myComponents/MyComponent';
2
+ export * from './hooks/useHooks';
3
+ export * from './utils/someUtil';
4
+ export * from './types/common';
@@ -0,0 +1,4 @@
1
+ export type CommonType = {
2
+ id: string;
3
+ name: string;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const someUtil: () => string;
@@ -0,0 +1,3 @@
1
+ export const someUtil = () => {
2
+ return 'Utility function';
3
+ };
package/package.json CHANGED
@@ -1,45 +1,40 @@
1
1
  {
2
2
  "name": "@xwadex/fesd-next",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "types": "dist/types/index.d.ts",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
8
13
  "files": [
9
14
  "dist"
10
15
  ],
11
16
  "scripts": {
12
- "publish:patch": "pnpm version patch",
13
- "publish:push": "git add . && git commit -m 'Patch Package Version' && git push",
14
- "publish:npm": "pnpm publish:patch && pnpm publish:push && pnpm publish --access=public"
17
+ "clean": "rm -rf dist",
18
+ "build": "npm run clean && tsc --project tsconfig.json && node copy-scss.js",
19
+ "prepare": "npm run build"
15
20
  },
16
- "exports": {
17
- ".": {
18
- "import": "./dist/index.js",
19
- "require": "./dist/index.js",
20
- "types": "./dist/types/index.d.ts"
21
- },
22
- "./components": {
23
- "import": "./dist/components/index.js",
24
- "require": "./dist/components/index.js",
25
- "types": "./dist/types/components/index.d.ts"
26
- },
27
- "./hooks": {
28
- "import": "./dist/hooks/index.js",
29
- "require": "./dist/hooks/index.js",
30
- "types": "./dist/types/hooks/index.d.ts"
31
- },
32
- "./styles/*": "./dist/styles/*"
21
+ "dependencies": {
22
+ "react": "^19.0.0",
23
+ "react-dom": "^19.0.0",
24
+ "next": "15.3.3"
25
+ },
26
+ "devDependencies": {
27
+ "typescript": "^5",
28
+ "@types/node": "^20",
29
+ "@types/react": "^19",
30
+ "@types/react-dom": "^19",
31
+ "eslint": "^9",
32
+ "eslint-config-next": "15.3.3",
33
+ "@eslint/eslintrc": "^3",
34
+ "sass": "^1.75.0"
33
35
  },
34
36
  "peerDependencies": {
35
- "next": ">=15",
36
37
  "react": ">=18",
37
- "react-dom": ">=18",
38
- "framer-motion": ">=12.0.0",
39
- "react-icons": ">=5.2.1",
40
- "tua-body-scroll-lock": ">=1.5.1"
41
- },
42
- "devDependencies": {
43
- "@types/body-scroll-lock": ">=3.1.2"
38
+ "react-dom": ">=18"
44
39
  }
45
40
  }
@@ -1,23 +0,0 @@
1
- "use client";
2
-
3
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
9
- import React, { useEffect, useState } from 'react';
10
- import { usePathname } from 'next/navigation';
11
- export var Demo = function Demo(_ref) {
12
- var title = _ref.title;
13
- var pathname = usePathname();
14
- var _useState = useState(title),
15
- _useState2 = _slicedToArray(_useState, 1),
16
- state = _useState2[0];
17
- useEffect(function () {
18
- console.log("pathname", pathname);
19
- }, [pathname]);
20
- return /*#__PURE__*/React.createElement("div", {
21
- className: "test"
22
- }, "Demo:", state, ", ", pathname);
23
- };
@@ -1 +0,0 @@
1
- export { Demo } from "./Demo";
@@ -1 +0,0 @@
1
- export { usePrevious } from "./usePrevState";
@@ -1,10 +0,0 @@
1
- 'use client';
2
-
3
- import { useEffect, useRef } from 'react';
4
- export var usePrevious = function usePrevious(value) {
5
- var ref = useRef(null);
6
- useEffect(function () {
7
- ref.current = value;
8
- }, [value]);
9
- return ref.current;
10
- };
@@ -1,3 +0,0 @@
1
- .test {
2
- background-color: #ff0000;
3
- }
@@ -1 +0,0 @@
1
- @forward "Demo";
@@ -1 +0,0 @@
1
- @forward "components";
@@ -1,3 +0,0 @@
1
- .test {
2
- background-color: #ff0000;
3
- }
@@ -1 +0,0 @@
1
- @forward "Demo";
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface PropsType {
3
- title: string;
4
- }
5
- export declare const Demo: React.FC<PropsType>;
6
- export {};
@@ -1 +0,0 @@
1
- export { Demo } from "./Demo";
@@ -1 +0,0 @@
1
- export { usePrevious } from "./usePrevState";
@@ -1,3 +0,0 @@
1
- type UsePrevious<T> = T | null;
2
- export declare const usePrevious: <T>(value: T) => UsePrevious<T>;
3
- export {};
@@ -1,3 +0,0 @@
1
- import { usePrevious as usePrevState } from './hooks/usePrevState';
2
- import { Demo as Demo } from './components/Demo';
3
- export { usePrevState, Demo };