placementt-core 1.400.1137 → 1.400.1140
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 +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,12 @@ yarn watch-local dev # or: yarn watch-local prod (or -d / -p)
|
|
|
18
18
|
|
|
19
19
|
Keeps `tsc --watch` running against your current working tree (including uncommitted changes), swapping in dev/prod config for the whole session the same way `test-local` does. On every successful compile it runs `yalc push`, which republishes to the yalc store **and** pushes the update straight into any repo that's already linked this package — no need to re-run anything on the consumer side after the first link.
|
|
20
20
|
|
|
21
|
-
Leave this running in its own terminal for as long as you're iterating. Stop it with Ctrl+C when you're done — it restores `package.json`, `src/firebase/firebaseConfig.tsx`, and `src/
|
|
21
|
+
Leave this running in its own terminal for as long as you're iterating. Stop it with Ctrl+C when you're done — it restores `package.json`, `src/firebase/firebaseConfig.tsx`, and `src/algoliaConfig.ts` to their committed state and resets `lib/` via `git checkout`, so your working tree is left clean automatically.
|
|
22
22
|
|
|
23
23
|
**Important:** whichever flavor (`dev`/`prod`) this is running as is what gets pushed to *every* linked consumer, regardless of which flavor they originally linked with — yalc tracks link targets by package name only, not by version. Don't run this in `prod` if you're mid-session testing against dev data elsewhere.
|
|
24
24
|
|
|
25
|
+
**Do not `git commit`/`git push` while this is running.** The swap only lives in your working tree until the watcher exits and restores it — committing mid-session bakes the temporary dev config (dev Firebase project, dev Algolia app, the local emulator connection uncommented) straight into real history. This has actually happened and reached `origin/main` — if you need to commit something while iterating, stop the watcher first (Ctrl+C, which restores the files automatically), commit, then restart it.
|
|
26
|
+
|
|
25
27
|
### 2. Run the matching watcher in the consuming repo
|
|
26
28
|
|
|
27
29
|
First time only, link the package (same command as the one-off flow below):
|
|
@@ -32,19 +34,19 @@ yarn core dev # or -d / -p — run in placementt-web or placementt-backend
|
|
|
32
34
|
|
|
33
35
|
Then, instead of manually restarting after every change, use one of:
|
|
34
36
|
|
|
35
|
-
**placementt-web —
|
|
37
|
+
**placementt-web — restart-based (preferred)**
|
|
36
38
|
```
|
|
37
|
-
yarn dev:core
|
|
39
|
+
yarn dev:core dev # or prod / -d / -p
|
|
38
40
|
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Caveat: since there's no server restart, if `watch-local`'s flavor changes *while* `dev:core-live` is open in the browser, the page can end up in a mixed state — the old Firebase Auth session from one project, new code pointing at the other. Do a hard refresh after switching flavors mid-session.
|
|
41
|
+
Watches `node_modules/placementt-core` and, on every change, kills whatever's on port 3000, clears `node_modules/.cache`, and restarts `yarn start`. Slower (a full recompile every time, several seconds) but reliable. The cache clear isn't optional — webpack treats `node_modules` packages as version-pinned/immutable for caching purposes, and since the local yalc build always publishes under the same constant sentinel version, a restart alone does *not* pick up the change (confirmed — a stale build kept getting served without it). The cache clear itself lives in the consuming repo's `prestart`/`prebuild` hook (`clear-local-core-cache.js`), not in this watcher, so a plain `yarn start` also gets it for free.
|
|
42
42
|
|
|
43
|
-
**placementt-web — restart
|
|
43
|
+
**placementt-web — live reload, no restart (use with caution)**
|
|
44
44
|
```
|
|
45
|
-
yarn dev:core dev # or prod / -d / -p
|
|
45
|
+
yarn dev:core-live dev # or prod / -d / -p
|
|
46
46
|
```
|
|
47
|
-
|
|
47
|
+
Runs the dev server through [craco](https://github.com/dilanx/craco) (`craco.config.js`), which tells webpack to actually watch `node_modules/placementt-core` and force a rebuild via `compiler.watching.invalidate()` whenever it changes — so changes show up through normal Fast Refresh with no server restart.
|
|
48
|
+
|
|
49
|
+
**Known to cause real breakage:** since this package's own Firebase SDK client gets hot-swapped into an already-running page, the Firestore SDK can end up with a corrupted in-memory client — surfaces as `FIRESTORE INTERNAL ASSERTION FAILED: Unexpected state` and keeps happening until you close the tab (not just reload) and open a fresh one. This got bad enough in practice that `dev:core` (restart-based, above) is now the recommended default instead — only reach for this if you specifically need faster iteration and are prepared to close/reopen tabs when Firestore errors start appearing. Also, since there's no server restart, if `watch-local`'s flavor changes *while* this is open in the browser, the page can end up in a mixed state — the old Firebase Auth session from one project, new code pointing at the other.
|
|
48
50
|
|
|
49
51
|
**placementt-backend**
|
|
50
52
|
```
|