@thejob/schema 2.1.2 → 2.1.4

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.
@@ -112,11 +112,11 @@
112
112
  "Bash(grep -n 'data\\\\.dict\\\\|dict\\\\b\\\\|$props\\\\|export let' /home/nadeem/Documents/GitHub/thejob-svelte-ui/src/lib/onboarding/wizards/job-seeker-wizard.svelte)",
113
113
  "Bash(grep -v \"^$\")",
114
114
  "Bash(grep -E '^\\\\s+\"[a-zA-Z]+\":\\\\s*\\\\{$' src/lib/i18n/dictionaries/en.json)",
115
- "Bash(sed -i 's|<title>Job search timeline - TheJob</title>|<title>{\\(data.dict?.pageTitles?.preferencesUrgency ?? \"Job search timeline\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"TheJob\"\\)}</title>|' urgency/+page.svelte)",
116
- "Bash(sed -i 's|<title>Job locations - TheJob</title>|<title>{\\(data.dict?.pageTitles?.preferencesLocations ?? \"Job locations\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"TheJob\"\\)}</title>|' locations/+page.svelte)",
117
- "Bash(sed -i 's|<title>Minimum salary - TheJob</title>|<title>{\\(data.dict?.pageTitles?.preferencesSalary ?? \"Minimum salary\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"TheJob\"\\)}</title>|' salary/+page.svelte)",
118
- "Bash(sed -i 's|<title>Job role - TheJob</title>|<title>{\\(data.dict?.pageTitles?.preferencesRole ?? \"Job role\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"TheJob\"\\)}</title>|' role/+page.svelte)",
119
- "Bash(sed -i 's|<title>Experience level - TheJob</title>|<title>{\\(data.dict?.pageTitles?.preferencesExperience ?? \"Experience level\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"TheJob\"\\)}</title>|' experience/+page.svelte)",
115
+ "Bash(sed -i 's|<title>Job search timeline - The Job</title>|<title>{\\(data.dict?.pageTitles?.preferencesUrgency ?? \"Job search timeline\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"The Job\"\\)}</title>|' urgency/+page.svelte)",
116
+ "Bash(sed -i 's|<title>Job locations - The Job</title>|<title>{\\(data.dict?.pageTitles?.preferencesLocations ?? \"Job locations\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"The Job\"\\)}</title>|' locations/+page.svelte)",
117
+ "Bash(sed -i 's|<title>Minimum salary - The Job</title>|<title>{\\(data.dict?.pageTitles?.preferencesSalary ?? \"Minimum salary\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"The Job\"\\)}</title>|' salary/+page.svelte)",
118
+ "Bash(sed -i 's|<title>Job role - The Job</title>|<title>{\\(data.dict?.pageTitles?.preferencesRole ?? \"Job role\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"The Job\"\\)}</title>|' role/+page.svelte)",
119
+ "Bash(sed -i 's|<title>Experience level - The Job</title>|<title>{\\(data.dict?.pageTitles?.preferencesExperience ?? \"Experience level\"\\)} - {\\(data.dict?.pageTitles?.siteName ?? \"The Job\"\\)}</title>|' experience/+page.svelte)",
120
120
  "Bash(python3 -c \"import json; d=json.load\\(open\\('src/lib/i18n/dictionaries/en.json'\\)\\); import sys; json.dump\\(d.get\\('search',{}\\), sys.stdout, indent=2\\)\")",
121
121
  "Bash(python3 -c \"import json; d=json.load\\(open\\('src/lib/i18n/dictionaries/sv.json'\\)\\); import sys; sv=d.get\\('search',{}\\); print\\('HAS' if 'noResults' in sv else 'MISSING', 'sv search.noResults'\\)\")",
122
122
  "Bash(grep -n \"[^=>]\\\\\"[A-Z][a-z][^\\\\\"]\\\\{5,\\\\}\\\\\"\\\\|>[A-Z][a-z][^<]\\\\{5,\\\\}<\" src/routes/\\\\[country\\\\]/\\\\[lang\\\\]/profile/+page.svelte)",
package/CLAUDE.md ADDED
@@ -0,0 +1,62 @@
1
+ # @thejob/schema — working notes for agents
2
+
3
+ Read this before changing anything. Fourteen repos depend on this package; a
4
+ careless edit here breaks all of them at once.
5
+
6
+ ## What this is
7
+
8
+ The **single source of truth** for The Job's data shapes: Yup schemas plus the
9
+ constants and enums that go with them. Plain Yup, no runtime dependencies, built
10
+ with `tsup` to dual ESM/CJS.
11
+
12
+ Current line is **v2** (branch `v2`, published `2.1.x`). v2 dropped v1's `objectId`
13
+ and `oneOfSchema` extensions and uses import-type for types; only
14
+ `date-string.extension.ts` remains.
15
+
16
+ ## Every schema lives here, and only here
17
+
18
+ **Never hand-roll a `yup.object` in a consuming service.** If a service needs a
19
+ partial validator, it derives one inline:
20
+
21
+ ```ts
22
+ UserSchema.pick(['headline', 'aboutMe'])
23
+ GroupSchema.omit(['createdAt', 'updatedAt'])
24
+ ```
25
+
26
+ Do **not** add `Update*Schema` / `Create*Schema` wrapper exports here for that
27
+ purpose — the pick/omit call at the use site says what it means and does not
28
+ multiply this package's surface. If a consumer needs a field that does not exist
29
+ yet, add it here first, then derive.
30
+
31
+ ## Changing a schema is a fourteen-repo change
32
+
33
+ The consumers on v2 are: admin, common, content, email, group, jobs, marketing,
34
+ page, sitemap, svelte-ui, taxonomy, user (plus data-processor and notification
35
+ transitively). **nestjs-api and nextjs-web are still pinned to v1 (`^1.0.106`)** and
36
+ are NOT to be bumped casually: that is a breaking major jump needing the tagged
37
+ `@todo SCHEMA-V2-MIGRATION` work, not a version bump. NestJS is decommissioned.
38
+
39
+ Practical consequences:
40
+
41
+ - **Adding** an optional field is safe. **Renaming, removing, or tightening** one is
42
+ not — it will typecheck here and fail in services you did not open.
43
+ - Publish, then update consumers deliberately. There is no workspace linking these;
44
+ each consumer pins a registry range.
45
+ - During development use **yalc** (`yalc publish` / `yalc push`), not a version bump,
46
+ so you are not burning versions to test a change. `pnpm dev` already runs
47
+ `tsup --watch --onSuccess "yalc publish --push"`.
48
+
49
+ ## Enum casing is load-bearing
50
+
51
+ Enum string values are consumed as literals across services and stored in Mongo, so
52
+ their casing is data, not style. Group `managedBy` / `visibility` / `status` are
53
+ **lowercase** (`system`, `private`, `archived`). Changing a case is a data migration,
54
+ not a refactor — existing documents will silently stop matching.
55
+
56
+ ## Conventions
57
+
58
+ - One module per domain (`user/`, `job/`, `group/`, …), each exporting its schema and
59
+ its constants, re-exported from `src/index.ts`.
60
+ - Types are derived from schemas (`yup.InferType`), never declared alongside them —
61
+ a hand-written type that drifts from its schema is the failure this package exists
62
+ to prevent.