sliftutils 0.31.0 → 0.33.0

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/.cursorrules CHANGED
@@ -26,18 +26,6 @@ We use MobX for state management. Components should use a variable called synced
26
26
 
27
27
  The code automatically updates on save, so do not ever run commands to rerun the site.
28
28
 
29
- In the implementation for every type of API, there should be a companion file to manage the session (ex smsSession.ts). This should export a function which makes calling the API functions simple by automatically managing the session. Because the session helper will be making the function calls, it can try catch them and appropriately handle the session errors that require regenerating the session. Of course, if it's not a session error, it should just rethrow it.
30
-
31
- Use createPersistentObject for persistent things like session states. It's accessed synchronously and the key will have an undefined value if it the value isn't set.
32
-
33
- let persistent = createPersistentObject<{
34
- token: string;
35
- }>("sms");
36
-
37
- persistent.token = "...";
38
- persistent.token;
39
-
40
-
41
29
  Coding Styles
42
30
  Try not to use "null", and instead always use "undefined".
43
31
 
@@ -81,12 +69,17 @@ Coding Styles
81
69
 
82
70
  Never use inline styles, always use the CSS helper.
83
71
 
84
- Don't use as any.
72
+ Don't use `as any`.
73
+
74
+ When you're making fetch calls and you get a type of any, you need to cast it to the actual type, and not leave it as any. The same goes for when you're deserializing values.
85
75
 
86
76
  DO NOT redeclare constants and copy their value. JUST IMPORT THEM!
87
77
 
88
78
  DO NOT redeclare types. JUST IMPORT THEM!
89
79
 
80
+ Do not try catch for no reason. If you can't actually handle the exception, just let it throw.
81
+
82
+
90
83
 
91
84
  General Styling
92
85
  Never use em or rem. Only use px or vw/vh/%.
package/index.d.ts CHANGED
@@ -254,7 +254,6 @@ declare module "sliftutils/render-utils/LocalStorageParam" {
254
254
  }
255
255
 
256
256
  declare module "sliftutils/render-utils/SyncedController" {
257
- /// <reference types="socket-function" />
258
257
  import { SocketRegistered } from "socket-function/SocketFunctionTypes";
259
258
  type RemapFunction<T> = T extends (...args: infer Args) => Promise<infer Return> ? {
260
259
  (...args: Args): Return | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -48,7 +48,7 @@
48
48
  "mobx": "^6.13.3",
49
49
  "preact": "10.24.3",
50
50
  "shell-quote": "^1.8.3",
51
- "socket-function": "^0.159.0",
51
+ "socket-function": "^0.160.0",
52
52
  "typenode": "^6.0.0",
53
53
  "typesafecss": "*",
54
54
  "ws": "^8.18.3",
@@ -1,4 +1,3 @@
1
- /// <reference types="socket-function" />
2
1
  import { SocketRegistered } from "socket-function/SocketFunctionTypes";
3
2
  type RemapFunction<T> = T extends (...args: infer Args) => Promise<infer Return> ? {
4
3
  (...args: Args): Return | undefined;
package/yarn.lock CHANGED
@@ -1494,10 +1494,10 @@ slash@^3.0.0:
1494
1494
  resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
1495
1495
  integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
1496
1496
 
1497
- socket-function@^0.159.0:
1498
- version "0.159.0"
1499
- resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-0.159.0.tgz#a847e26840461cbb9355cb84ec801975c5e0bd07"
1500
- integrity sha512-CmNF6PRjHqEzb82Fyu4PEuAqoaTR0HZJzZr2lzhzlq215vXrIh/X0m68EI0G+OlSVGrUt0Ntf2AO68svpih7fw==
1497
+ socket-function@^0.160.0:
1498
+ version "0.160.0"
1499
+ resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-0.160.0.tgz#63faff26a65242723df5ac15a35455991ca04e0b"
1500
+ integrity sha512-l7UHdN+k3y4p+dSg6AE2gjUEHvyx8n+TaKe/GNNjfGKsIGSrNQ/2e3v3AYkkh/zdLjZDqy9c+410kMuTIBJIbA==
1501
1501
  dependencies:
1502
1502
  "@types/pako" "^2.0.3"
1503
1503
  "@types/ws" "^8.5.3"