cyperful 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,7 @@
1
1
  (() => {
2
+ if (window.__cyperfulAgentInitialized)
3
+ return;
4
+ window.__cyperfulAgentInitialized = !0;
2
5
  const f = console.log, d = (...t) => f("[Cyperful Agent]", ...t);
3
6
  d("Loading...");
4
7
  const { CYPERFUL_ORIGIN: u } = __CYPERFUL_CONFIG__;
@@ -7,28 +10,28 @@
7
10
  return;
8
11
  }
9
12
  let y = 0;
10
- const i = (t, n, e = null) => {
11
- let s = null;
13
+ const s = (t, e, n = null) => {
14
+ let i = null;
12
15
  try {
13
16
  const r = Date.now(), c = `${r}-${y++}`;
14
- if ("url" in n && n.url != null)
17
+ if ("url" in e && e.url != null)
15
18
  try {
16
- const o = new URL(n.url, window.location.origin);
19
+ const o = new URL(e.url, window.location.origin);
17
20
  if (o.origin === u)
18
21
  return null;
19
- o.origin === window.location.origin && (n.url = o.pathname + o.search + o.hash);
22
+ o.origin === window.location.origin && (e.url = o.pathname + o.search + o.hash);
20
23
  } catch {
21
24
  }
22
- s = {
25
+ i = {
23
26
  type: t,
24
- data: n,
27
+ data: e,
25
28
  id: c,
26
29
  timestamp: r,
27
- start_id: e ? e.id : void 0
28
- }, window.parent.postMessage(s, u);
30
+ start_id: n ? n.id : void 0
31
+ }, window.parent.postMessage(i, u);
29
32
  } catch {
30
33
  }
31
- return s;
34
+ return i;
32
35
  };
33
36
  for (const t of [
34
37
  "log",
@@ -38,15 +41,15 @@
38
41
  "dir",
39
42
  "debug"
40
43
  ]) {
41
- const n = console[t];
42
- n && (console[t] = (...e) => {
43
- n.apply(console, e), i("log", { level: t, args: e });
44
+ const e = console[t];
45
+ e && (console[t] = (...n) => {
46
+ e.apply(console, n), s("log", { level: t, args: n });
44
47
  });
45
48
  }
46
49
  window.addEventListener("error", (t) => {
47
- i("global_error", { message: t.error.toString() });
50
+ s("global_error", { message: t.error.toString() });
48
51
  }), window.addEventListener("unhandledrejection", (t) => {
49
- i("unhandledrejection", { message: t.reason.toString() });
52
+ s("unhandledrejection", { message: t.reason.toString() });
50
53
  });
51
54
  function w(t) {
52
55
  try {
@@ -57,46 +60,46 @@
57
60
  }
58
61
  }
59
62
  function g(t) {
60
- const n = {};
61
- for (const [e, s] of t.entries())
62
- n[e] = s.toString();
63
- return n;
63
+ const e = {};
64
+ for (const [n, i] of t.entries())
65
+ i instanceof Blob ? e[n] = `[[ Blob: ${i.size} bytes ]]` : e[n] = i.toString();
66
+ return e;
64
67
  }
65
68
  const _ = window.XMLHttpRequest;
66
69
  function m() {
67
- const t = new _(), n = t.open;
68
- return t.open = (...e) => {
69
- const [s, r, c] = e, o = i("xhr", {
70
- method: s,
70
+ const t = new _(), e = t.open;
71
+ return t.open = (...n) => {
72
+ const [i, r, c] = n, o = s("xhr", {
73
+ method: i,
71
74
  url: r
72
75
  // body,
73
76
  });
74
77
  return t.addEventListener("load", () => {
75
- o && i(
78
+ o && s(
76
79
  "xhr:finished",
77
80
  { status: t.status, response: t.response },
78
81
  o
79
82
  );
80
- }), n.apply(this, e);
83
+ }), e.apply(this, n);
81
84
  }, t;
82
85
  }
83
86
  window.XMLHttpRequest = m;
84
87
  const L = window.fetch;
85
88
  window.fetch = (...t) => {
86
- const [n, e = {}] = typeof t[0] == "string" || t[0] instanceof URL ? [t[0], t[1]] : [t[0].url, t[0]], s = e.method ?? "GET", r = e.body, c = e.headers || {}, o = c["content-type"] || c["Content-Type"] || void 0, v = r instanceof FormData ? g(r) : o != null && o.includes("application/json") ? w(r) : r, p = i("fetch", {
87
- method: s,
88
- url: n.toString(),
89
- body: v,
89
+ const [e, n = {}] = typeof t[0] == "string" || t[0] instanceof URL ? [t[0], t[1]] : [t[0].url, t[0]], i = n.method ?? "GET", r = n.body, c = n.headers || {}, o = c["content-type"] || c["Content-Type"] || void 0, R = r instanceof FormData ? g(r) : o != null && o.includes("application/json") ? w(r) : r, p = s("fetch", {
90
+ method: i,
91
+ url: e.toString(),
92
+ body: R,
90
93
  bodyType: o
91
94
  }), h = L(...t);
92
- return h.then(async (a) => {
93
- const l = a.headers.get("content-type") || "", b = l.includes("application/json") ? await a.clone().json() : l.includes("text/") ? await a.clone().text() : `[[ Unhandled content-type: ${l || "<empty>"} ]]`;
94
- p && i(
95
+ return h.then(async (l) => {
96
+ const a = l.headers.get("content-type") || "", v = a.includes("application/json") ? await l.clone().json() : a.includes("text/") ? await l.clone().text() : `[[ Unhandled content-type: ${a || "<empty>"} ]]`;
97
+ p && s(
95
98
  "fetch:finished",
96
99
  {
97
- status: a.status,
98
- responseType: l || void 0,
99
- response: b
100
+ status: l.status,
101
+ responseType: a || void 0,
102
+ response: v
100
103
  },
101
104
  p
102
105
  );
@@ -105,14 +108,14 @@
105
108
  };
106
109
  const S = history.pushState;
107
110
  history.pushState = (...t) => {
108
- S.apply(history, t), i("client_navigate", {
111
+ S.apply(history, t), s("client_navigate", {
109
112
  url: location.href,
110
113
  replace: !1
111
114
  });
112
115
  };
113
- const R = history.replaceState;
116
+ const b = history.replaceState;
114
117
  history.replaceState = (...t) => {
115
- R.apply(history, t), i("client_navigate", {
118
+ b.apply(history, t), s("client_navigate", {
116
119
  url: location.href,
117
120
  replace: !0
118
121
  });
data/public/index.html CHANGED
@@ -1,14 +1,14 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/assets/favicon-DMdBZQlK.ico" />
7
7
  <title>Cyperful</title>
8
- <script type="module" crossorigin src="/assets/index-B_-TcqHl.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CDElGKtz.css">
8
+ <script type="module" crossorigin src="/assets/index-CrBQcYdq.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-Uj6YFMhM.css">
10
10
  </head>
11
- <body>
11
+ <body class="bg-stone-900 text-slate-100">
12
12
  <div id="root"></div>
13
13
  </body>
14
14
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyperful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wyatt Ades
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-27 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -62,11 +62,13 @@ files:
62
62
  - lib/cyperful/commands.rb
63
63
  - lib/cyperful/driver.rb
64
64
  - lib/cyperful/framework_injections.rb
65
+ - lib/cyperful/railtie.rb
65
66
  - lib/cyperful/test_parser.rb
66
67
  - lib/cyperful/ui_server.rb
67
68
  - public/assets/favicon-DMdBZQlK.ico
68
- - public/assets/index-B_-TcqHl.js
69
- - public/assets/index-CDElGKtz.css
69
+ - public/assets/index-CrBQcYdq.js
70
+ - public/assets/index-Uj6YFMhM.css
71
+ - public/assets/syntax-highlighter-worker-Cumko8SL.js
70
72
  - public/frame-agent.js
71
73
  - public/index.html
72
74
  homepage: https://github.com/stepful/cyperful