react-grab 0.0.15 → 0.0.17

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.
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @license MIT
5
+ *
6
+ * Copyright (c) 2025 Aiden Bai
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ // src/plugins/vite.ts
13
+ var reactGrab = (options = {}) => {
14
+ const {
15
+ adapter,
16
+ enabled = true
17
+ } = options;
18
+ const dataAttrs = [];
19
+ if (enabled !== void 0) {
20
+ dataAttrs.push(`data-enabled="${enabled}"`);
21
+ }
22
+ if (adapter !== void 0) {
23
+ dataAttrs.push(`data-adapter="${adapter}"`);
24
+ }
25
+ const scriptTag = `<script
26
+ src="//unpkg.com/react-grab/dist/index.global.js"
27
+ crossorigin="anonymous"
28
+ ${dataAttrs.join("\n ")}
29
+ ><\/script>`;
30
+ return {
31
+ apply: "serve",
32
+ name: "vite-plugin-react-grab",
33
+ transformIndexHtml: {
34
+ handler(html) {
35
+ return html.replace(
36
+ "<head>",
37
+ `<head>
38
+ ${scriptTag}`
39
+ );
40
+ },
41
+ order: "pre"
42
+ }
43
+ };
44
+ };
45
+
46
+ exports.reactGrab = reactGrab;
@@ -0,0 +1,14 @@
1
+ interface ReactGrabPluginOptions {
2
+ adapter?: "cursor";
3
+ enabled?: boolean;
4
+ }
5
+ declare const reactGrab: (options?: ReactGrabPluginOptions) => {
6
+ apply: "serve";
7
+ name: string;
8
+ transformIndexHtml: {
9
+ handler(html: string): string;
10
+ order: "pre";
11
+ };
12
+ };
13
+
14
+ export { type ReactGrabPluginOptions, reactGrab };
@@ -0,0 +1,14 @@
1
+ interface ReactGrabPluginOptions {
2
+ adapter?: "cursor";
3
+ enabled?: boolean;
4
+ }
5
+ declare const reactGrab: (options?: ReactGrabPluginOptions) => {
6
+ apply: "serve";
7
+ name: string;
8
+ transformIndexHtml: {
9
+ handler(html: string): string;
10
+ order: "pre";
11
+ };
12
+ };
13
+
14
+ export { type ReactGrabPluginOptions, reactGrab };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+
10
+ // src/plugins/vite.ts
11
+ var reactGrab = (options = {}) => {
12
+ const {
13
+ adapter,
14
+ enabled = true
15
+ } = options;
16
+ const dataAttrs = [];
17
+ if (enabled !== void 0) {
18
+ dataAttrs.push(`data-enabled="${enabled}"`);
19
+ }
20
+ if (adapter !== void 0) {
21
+ dataAttrs.push(`data-adapter="${adapter}"`);
22
+ }
23
+ const scriptTag = `<script
24
+ src="//unpkg.com/react-grab/dist/index.global.js"
25
+ crossorigin="anonymous"
26
+ ${dataAttrs.join("\n ")}
27
+ ><\/script>`;
28
+ return {
29
+ apply: "serve",
30
+ name: "vite-plugin-react-grab",
31
+ transformIndexHtml: {
32
+ handler(html) {
33
+ return html.replace(
34
+ "<head>",
35
+ `<head>
36
+ ${scriptTag}`
37
+ );
38
+ },
39
+ order: "pre"
40
+ }
41
+ };
42
+ };
43
+
44
+ export { reactGrab };
package/package.json CHANGED
@@ -1,8 +1,18 @@
1
1
  {
2
2
  "name": "react-grab",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
- "keywords": [],
5
+ "keywords": [
6
+ "react",
7
+ "grab",
8
+ "cursor",
9
+ "claude",
10
+ "code",
11
+ "context",
12
+ "changes",
13
+ "modifications",
14
+ "modification"
15
+ ],
6
16
  "homepage": "https://github.com/aidenybai/react-grab#readme",
7
17
  "bugs": {
8
18
  "url": "https://github.com/aidenybai/react-grab/issues"
@@ -29,6 +39,16 @@
29
39
  "default": "./dist/index.cjs"
30
40
  }
31
41
  },
42
+ "./plugins/vite": {
43
+ "import": {
44
+ "types": "./dist/plugins/vite.d.ts",
45
+ "default": "./dist/plugins/vite.js"
46
+ },
47
+ "require": {
48
+ "types": "./dist/plugins/vite.d.cts",
49
+ "default": "./dist/plugins/vite.cjs"
50
+ }
51
+ },
32
52
  "./dist/*": "./dist/*.js",
33
53
  "./dist/*.js": "./dist/*.js",
34
54
  "./dist/*.cjs": "./dist/*.cjs",
@@ -57,10 +77,10 @@
57
77
  "access": "public"
58
78
  },
59
79
  "dependencies": {
60
- "bippy": "^0.3.31"
80
+ "bippy": "^0.3.32"
61
81
  },
62
82
  "scripts": {
63
- "build": "tsup",
83
+ "build": "NODE_ENV=production tsup",
64
84
  "dev": "tsup --watch --ignore-watch dist",
65
85
  "lint": "eslint src/**/*.ts",
66
86
  "lint:fix": "eslint src/**/*.ts --fix",