@tipsy-studio/sdk 0.0.1

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,25 @@
1
+ # @tipsy-studio/sdk
2
+
3
+ React sdk for Tipsy Studio apps.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @tipsy-studio/sdk react
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ React-specific exports are available from the `/react` subpath.
14
+
15
+ ```tsx
16
+ import { useMounted } from "@tipsy-studio/sdk/react";
17
+
18
+ export function Demo() {
19
+ const mounted = useMounted();
20
+
21
+ if (!mounted) return null;
22
+
23
+ return <div>Client content</div>;
24
+ }
25
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/react.cjs ADDED
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ // src/hooks/useMounted.ts
6
+ function useMounted() {
7
+ const [mounted, setMounted] = react.useState(false);
8
+ react.useEffect(() => {
9
+ setMounted(true);
10
+ console.log("npm \u5305\u6D4B\u8BD5\u901A\u8FC7666");
11
+ }, []);
12
+ return mounted;
13
+ }
14
+
15
+ exports.useMounted = useMounted;
16
+ //# sourceMappingURL=react.cjs.map
17
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useMounted.ts"],"names":["useState","useEffect"],"mappings":";;;;;AAIO,SAAS,UAAA,GAA+B;AAC7C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAIA,eAAS,KAAK,CAAA;AAE5C,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,OAAA,CAAQ,IAAI,uCAAc,CAAA;AAAA,EAC5B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,OAAA;AACT","file":"react.cjs","sourcesContent":["import { useEffect, useState } from \"react\";\n\nexport type UseMountedReturn = boolean;\n\nexport function useMounted(): UseMountedReturn {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n console.log(\"npm 包测试通过666\");\n }, []);\n\n return mounted;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ type UseMountedReturn = boolean;
2
+ declare function useMounted(): UseMountedReturn;
3
+
4
+ export { type UseMountedReturn, useMounted };
@@ -0,0 +1,4 @@
1
+ type UseMountedReturn = boolean;
2
+ declare function useMounted(): UseMountedReturn;
3
+
4
+ export { type UseMountedReturn, useMounted };
package/dist/react.js ADDED
@@ -0,0 +1,15 @@
1
+ import { useState, useEffect } from 'react';
2
+
3
+ // src/hooks/useMounted.ts
4
+ function useMounted() {
5
+ const [mounted, setMounted] = useState(false);
6
+ useEffect(() => {
7
+ setMounted(true);
8
+ console.log("npm \u5305\u6D4B\u8BD5\u901A\u8FC7666");
9
+ }, []);
10
+ return mounted;
11
+ }
12
+
13
+ export { useMounted };
14
+ //# sourceMappingURL=react.js.map
15
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useMounted.ts"],"names":[],"mappings":";;;AAIO,SAAS,UAAA,GAA+B;AAC7C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAE5C,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,UAAA,CAAW,IAAI,CAAA;AACf,IAAA,OAAA,CAAQ,IAAI,uCAAc,CAAA;AAAA,EAC5B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,OAAA;AACT","file":"react.js","sourcesContent":["import { useEffect, useState } from \"react\";\n\nexport type UseMountedReturn = boolean;\n\nexport function useMounted(): UseMountedReturn {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n console.log(\"npm 包测试通过666\");\n }, []);\n\n return mounted;\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@tipsy-studio/sdk",
3
+ "version": "0.0.1",
4
+ "description": "React sdk for Tipsy Studio apps.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.cjs"
16
+ },
17
+ "./react": {
18
+ "types": "./dist/react.d.ts",
19
+ "import": "./dist/react.js",
20
+ "require": "./dist/react.cjs"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsup",
29
+ "dev": "tsup --watch",
30
+ "typecheck": "tsc --noEmit",
31
+ "prepublishOnly": "npm run typecheck && npm run build"
32
+ },
33
+ "peerDependencies": {
34
+ "react": "^18 || ^19"
35
+ },
36
+ "devDependencies": {
37
+ "@types/react": "^19.1.13",
38
+ "react": "^19.2.0",
39
+ "tsup": "^8.5.0",
40
+ "typescript": "5.9.2"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "keywords": [
46
+ "react",
47
+ "hooks",
48
+ "typescript"
49
+ ]
50
+ }