@kirill.konshin/lint 0.8.7 → 0.8.8

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [
5
5
  "tanstack-intent"
6
6
  ],
7
- "version": "0.8.7",
7
+ "version": "0.8.8",
8
8
  "type": "module",
9
9
  "skipGenerate": true,
10
10
  "bin": {
@@ -70,6 +70,42 @@ files:
70
70
  - '!.next/standalone/node_modules/electron'
71
71
  ```
72
72
 
73
+ Keep `asar` on (the electron-builder default). The packaged app is read-only, so:
74
+
75
+ - Unpack native code by name: electron-builder unpacks it by itself only for dependencies, not for files that come in through `files`, such as the standalone `node_modules`
76
+
77
+ ```yaml
78
+ asarUnpack:
79
+ - '**/*.node'
80
+ - '**/node_modules/sharp/**'
81
+ - '**/node_modules/@img/**'
82
+ ```
83
+
84
+ - Next.js writes its ISR, fetch and image caches inside the app: `next-electron-rsc` keeps the ISR and fetch cache in memory and serves images as they are; `experimental_cacheDir` of `createHandler` moves them to Electron's `userData` folder
85
+ - If the dependency install of electron-builder fails while it builds `sharp` from source, set `npmRebuild: false`: the standalone folder has its own `node_modules`
86
+
87
+ # macOS Signing
88
+
89
+ Sign in ONE pass: a custom `mac.sign` (electron-builder 26) that calls `@electron/osx-sign` replaces electron-builder's own signing; never sign ad hoc first and again in `afterSign` (`afterSign` only runs when electron-builder signed itself). Keep `mac.identity` set (`-` is enough) so electron-builder runs the signing step that calls `sign`.
90
+
91
+ ```ts
92
+ mac: {
93
+ identity: '-',
94
+ sign: ({ app }) =>
95
+ sign({
96
+ app,
97
+ identity: '<certificate name>',
98
+ batchCodesignCalls: true, // one codesign per argument group
99
+ ignore: (file) => file.endsWith('.pak'), // sealed by Electron's framework
100
+ optionsForFile: () => ({ timestamp: 'none' }), // ONLY without notarization
101
+ }),
102
+ },
103
+ ```
104
+
105
+ - osx-sign runs one `codesign` per binary-looking file, with an Apple timestamp request each; 223 of 245 files of an Electron app are `.pak`
106
+ - Measured (365 MB app): 84 s -> 25 s (batch + no timestamp) -> 10 s (+ skip `.pak`), `codesign --verify --deep --strict` still passes
107
+ - Notarized builds (Developer ID) need the timestamp: keep the default there and only batch and skip `.pak`
108
+
73
109
  # CI Builds
74
110
 
75
111
  ## Gitlab
@@ -76,6 +76,14 @@ export default function Page({ params }: PageProps<'/blog/[slug]'>) {
76
76
  - Example: `actions.ts` with `'use server'` actions beside a `'use client'` page
77
77
  - Admin pages: the `lint-mui` skill.
78
78
 
79
+ # Real-time updates
80
+
81
+ For server-to-client updates, use HTTP streaming or Server-Sent Events from a Route Handler (a `ReadableStream` in a `Response`). Do not use WebSockets.
82
+
83
+ - The browser integration is cleaner: plain `fetch` or `EventSource`, with reconnects, proxies and cookies as for any other request
84
+ - No instrumentation is needed: a Route Handler cannot accept a WebSocket upgrade, so a WebSocket server needs a custom server or an instrumentation hook
85
+ - In Electron with `next-electron-rsc`, streaming works in-process; a WebSocket needs a real socket for the HTTP upgrade, so it needs an open port (the `lint-electron` skill)
86
+
79
87
  # `next.config.ts`
80
88
 
81
89
  `defineNextConfig` of `@kirill.konshin/next/config`: what it sets and how to extend it is in the `next` skill, it installs with the package. The same skill lists the package's utilities (`AppLink`, `SoftLink`, `NoSSR`, …).