@paris-ias/trees 1.8.57 → 2.0.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.
Files changed (172) hide show
  1. package/dist/form/actions.d.ts +130 -0
  2. package/dist/form/affiliations.d.ts +293 -0
  3. package/dist/form/apps.d.ts +210 -0
  4. package/dist/form/disciplines.d.ts +41 -0
  5. package/dist/form/events.d.ts +1398 -0
  6. package/dist/form/fellowships.d.ts +2123 -0
  7. package/dist/form/files.d.ts +41 -0
  8. package/dist/form/mailing.d.ts +63 -0
  9. package/dist/form/news.d.ts +406 -0
  10. package/dist/form/people.d.ts +1063 -0
  11. package/dist/form/projects.d.ts +565 -0
  12. package/dist/form/publications.d.ts +616 -0
  13. package/dist/form/tags.d.ts +55 -0
  14. package/dist/form/users.d.ts +947 -0
  15. package/dist/graphql/client/events/query.list.events.gql +0 -1
  16. package/dist/graphql/schemas/apex-resolvers-list.json +45 -0
  17. package/dist/graphql/schemas/schema.apex.graphql +34 -6
  18. package/dist/graphql/schemas/schema.website.graphql +31 -4
  19. package/dist/graphql/schemas/website-resolvers-list.json +21 -0
  20. package/dist/list/actions.d.ts +104 -0
  21. package/dist/list/affiliations.d.ts +104 -0
  22. package/dist/list/apps.d.ts +104 -0
  23. package/dist/list/disciplines.d.ts +102 -0
  24. package/dist/list/events.d.ts +173 -0
  25. package/dist/list/fellowships.d.ts +124 -0
  26. package/dist/list/files.d.ts +102 -0
  27. package/dist/list/mailing.d.ts +102 -0
  28. package/dist/list/news.d.ts +104 -0
  29. package/dist/list/people.d.ts +154 -0
  30. package/dist/list/projects.d.ts +104 -0
  31. package/dist/list/publications.d.ts +128 -0
  32. package/dist/list/tags.d.ts +104 -0
  33. package/dist/list/users.d.ts +154 -0
  34. package/index.d.ts +31 -0
  35. package/package.json +173 -14
  36. package/readme.md +1 -1
  37. package/index.ts +0 -63
  38. package/lib/README.md +0 -206
  39. package/lib/buildClientGraphQL.ts +0 -342
  40. package/lib/buildDefaults.ts +0 -0
  41. package/lib/buildSchemas.ts +0 -109
  42. package/lib/generate.ts +0 -505
  43. package/lib/generateAll.ts +0 -231
  44. package/lib/utils.ts +0 -24
  45. package/src/LICENSE +0 -661
  46. package/src/actions/graphql/client/query.get.actions.gql +0 -22
  47. package/src/actions/graphql/client/query.list.actions.gql +0 -32
  48. package/src/actions/graphql/server/apex.types.actions.graphql +0 -15
  49. package/src/actions/models/actions.ts +0 -147
  50. package/src/affiliations/graphql/client/query.get.affiliations.gql +0 -37
  51. package/src/affiliations/graphql/client/query.list.affiliations.gql +0 -43
  52. package/src/affiliations/graphql/server/shared.types.affiliations.graphql +0 -20
  53. package/src/affiliations/models/affiliations.ts +0 -130
  54. package/src/affiliations/models/members.ts +0 -11
  55. package/src/affiliations/models/partners.ts +0 -9
  56. package/src/apps/graphql/client/query.get.apps.gql +0 -33
  57. package/src/apps/graphql/client/query.list.apps.gql +0 -43
  58. package/src/apps/models/apps.ts +0 -195
  59. package/src/events/graphql/client/query.get.events.gql +0 -119
  60. package/src/events/graphql/client/query.list.events.gql +0 -40
  61. package/src/events/graphql/server/shared.inputs.events.graphql +0 -24
  62. package/src/events/models/eventSlot.ts +0 -73
  63. package/src/events/models/events.ts +0 -569
  64. package/src/fellowships/graphql/client/query.get.fellowships.gql +0 -163
  65. package/src/fellowships/graphql/client/query.list.fellowships.gql +0 -49
  66. package/src/fellowships/graphql/server/apex.inputs.fellowshipDetails.graphql +0 -13
  67. package/src/fellowships/graphql/server/shared.types.fellowshipDetails.graphql +0 -13
  68. package/src/fellowships/graphql/server/shared.types.fellowships.graphql +0 -38
  69. package/src/fellowships/models/fellowshipDetails.ts +0 -145
  70. package/src/fellowships/models/fellowships.ts +0 -341
  71. package/src/files/graphql/client/query.get.files.gql +0 -24
  72. package/src/files/graphql/client/query.list.files.gql +0 -37
  73. package/src/files/graphql/server/apex.inputs.files.graphql +0 -7
  74. package/src/files/graphql/server/apex.inputs.video.graphql +0 -9
  75. package/src/files/graphql/server/apex.types.files.graphql +0 -4
  76. package/src/files/graphql/server/shared.inputs.image.graphql +0 -9
  77. package/src/files/graphql/server/shared.types.files.graphql +0 -15
  78. package/src/files/graphql/server/shared.types.image.graphql +0 -9
  79. package/src/files/graphql/server/shared.types.video.graphql +0 -9
  80. package/src/files/models/files.ts +0 -113
  81. package/src/files/models/gallery.ts +0 -11
  82. package/src/files/models/image.ts +0 -159
  83. package/src/files/models/video.ts +0 -166
  84. package/src/form.ts +0 -52
  85. package/src/index.ts +0 -98
  86. package/src/list.ts +0 -34
  87. package/src/mailing/graphql/client/query.get.mailing.gql +0 -24
  88. package/src/mailing/graphql/client/query.list.mailing.gql +0 -23
  89. package/src/mailing/graphql/server/apex.types.mailing.graphql +0 -13
  90. package/src/mailing/models/mailing.ts +0 -123
  91. package/src/misc/graphql/client/apex.mutations.delete.gql +0 -0
  92. package/src/misc/graphql/client/apex.mutations.upsert.gql +0 -0
  93. package/src/misc/graphql/client/apex.queries.login.gql +0 -0
  94. package/src/misc/graphql/client/query.get.disciplines.gql +0 -17
  95. package/src/misc/graphql/client/query.get.tags.gql +0 -13
  96. package/src/misc/graphql/client/query.list.disciplines.gql +0 -23
  97. package/src/misc/graphql/client/query.list.tags.gql +0 -23
  98. package/src/misc/graphql/server/apex.inputs.misc.graphql +0 -13
  99. package/src/misc/graphql/server/apex.inputs.socials.graphql +0 -12
  100. package/src/misc/graphql/server/apex.mutations.graphql +0 -23
  101. package/src/misc/graphql/server/apex.queries.graphql +0 -36
  102. package/src/misc/graphql/server/apex.types.disciplines.graphql +0 -4
  103. package/src/misc/graphql/server/apex.types.tags.graphql +0 -4
  104. package/src/misc/graphql/server/shared.enums.graphql +0 -112
  105. package/src/misc/graphql/server/shared.inputs.misc.graphql +0 -101
  106. package/src/misc/graphql/server/shared.queries.graphql +0 -35
  107. package/src/misc/graphql/server/shared.types.disciplines.graphql +0 -8
  108. package/src/misc/graphql/server/shared.types.events.graphql +0 -39
  109. package/src/misc/graphql/server/shared.types.location.graphql +0 -17
  110. package/src/misc/graphql/server/shared.types.misc.graphql +0 -120
  111. package/src/misc/graphql/server/shared.types.related.graphql +0 -10
  112. package/src/misc/graphql/server/shared.types.relatedAffiliation.graphql +0 -7
  113. package/src/misc/graphql/server/shared.types.relatedEvent.graphql +0 -7
  114. package/src/misc/graphql/server/shared.types.relatedFellowships.graphql +0 -7
  115. package/src/misc/graphql/server/shared.types.relatedNews.graphql +0 -7
  116. package/src/misc/graphql/server/shared.types.relatedPeople.graphql +0 -6
  117. package/src/misc/graphql/server/shared.types.relatedProject.graphql +0 -7
  118. package/src/misc/graphql/server/shared.types.relatedPublications.graphql +0 -6
  119. package/src/misc/graphql/server/shared.types.socials.graphql +0 -22
  120. package/src/misc/graphql/server/shared.types.tags.graphql +0 -11
  121. package/src/misc/graphql/server/website.mutations.graphql +0 -4
  122. package/src/misc/models/disciplines.ts +0 -116
  123. package/src/misc/models/location.ts +0 -136
  124. package/src/misc/models/organizers.ts +0 -13
  125. package/src/misc/models/related.ts +0 -123
  126. package/src/misc/models/relatedEvents.ts +0 -16
  127. package/src/misc/models/relatedFellowships.ts +0 -7
  128. package/src/misc/models/relatedNews.ts +0 -13
  129. package/src/misc/models/relatedPeople.ts +0 -8
  130. package/src/misc/models/relatedProject.ts +0 -14
  131. package/src/misc/models/relatedPublications.ts +0 -14
  132. package/src/misc/models/socials.ts +0 -133
  133. package/src/misc/models/sponsor.ts +0 -13
  134. package/src/misc/models/tags.ts +0 -116
  135. package/src/misc/models/taxonomy.ts +0 -1
  136. package/src/model.ts +0 -7
  137. package/src/news/graphql/client/query.get.news.gql +0 -128
  138. package/src/news/graphql/client/query.list.news.gql +0 -35
  139. package/src/news/graphql/server/share.types.news.graphql +0 -27
  140. package/src/news/models/news.ts +0 -257
  141. package/src/people/graphql/client/query.get.people.gql +0 -173
  142. package/src/people/graphql/client/query.get.users.gql +0 -0
  143. package/src/people/graphql/client/query.list.people.gql +0 -55
  144. package/src/people/graphql/client/query.list.users.gql +0 -31
  145. package/src/people/graphql/server/apex.inputs.consent.graphql +0 -9
  146. package/src/people/graphql/server/apex.inputs.groups.graphql +0 -8
  147. package/src/people/graphql/server/apex.inputs.vintage.graphql +0 -6
  148. package/src/people/graphql/server/shared.types.consent.graphql +0 -9
  149. package/src/people/graphql/server/shared.types.groups.graphql +0 -8
  150. package/src/people/graphql/server/shared.types.people.graphql +0 -29
  151. package/src/people/graphql/server/shared.types.position.graphql +0 -6
  152. package/src/people/graphql/server/shared.types.users.graphql +0 -17
  153. package/src/people/graphql/server/shared.types.vintage.graphql +0 -6
  154. package/src/people/models/consent.ts +0 -82
  155. package/src/people/models/discussants.ts +0 -9
  156. package/src/people/models/experiences.ts +0 -38
  157. package/src/people/models/fellows.ts +0 -12
  158. package/src/people/models/groups.ts +0 -58
  159. package/src/people/models/people.ts +0 -243
  160. package/src/people/models/position.ts +0 -62
  161. package/src/people/models/speakers.ts +0 -9
  162. package/src/people/models/users.ts +0 -252
  163. package/src/people/models/vintage.ts +0 -124
  164. package/src/projects/graphql/client/query.get.projects.gql +0 -166
  165. package/src/projects/graphql/client/query.list.projects.gql +0 -33
  166. package/src/projects/graphql/server/shared.types.projects.graphql +0 -29
  167. package/src/projects/models/projects.ts +0 -249
  168. package/src/publications/graphql/client/query.get.publications.gql +0 -169
  169. package/src/publications/graphql/client/query.list.publications.gql +0 -35
  170. package/src/publications/graphql/server/shared.types.publications.graphql +0 -34
  171. package/src/publications/models/article.ts +0 -262
  172. package/src/publications/models/publications.ts +0 -306
package/package.json CHANGED
@@ -1,34 +1,193 @@
1
1
  {
2
2
  "name": "@paris-ias/trees",
3
- "version": "1.8.57",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "description": "Type definitions and schema generator for Paris IAS data management system",
8
+ "author": "Antoine Cordelois, Paris Institute for Advanced Study",
9
+ "license": "AGPL-3.0",
10
+ "keywords": [
11
+ "graphql",
12
+ "types",
13
+ "schema",
14
+ "paris-ias"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/IEA-Paris/trees.git"
19
+ },
20
+ "engines": {
21
+ "node": ">=18.0.0"
22
+ },
23
+ "exports": {
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js"
27
+ },
28
+ "./form/actions": {
29
+ "types": "./dist/form/actions.d.ts",
30
+ "import": "./dist/form/actions.js"
31
+ },
32
+ "./form/affiliations": {
33
+ "types": "./dist/form/affiliations.d.ts",
34
+ "import": "./dist/form/affiliations.js"
35
+ },
36
+ "./form/apps": {
37
+ "types": "./dist/form/apps.d.ts",
38
+ "import": "./dist/form/apps.js"
39
+ },
40
+ "./form/disciplines": {
41
+ "types": "./dist/form/disciplines.d.ts",
42
+ "import": "./dist/form/disciplines.js"
43
+ },
44
+ "./form/events": {
45
+ "types": "./dist/form/events.d.ts",
46
+ "import": "./dist/form/events.js"
47
+ },
48
+ "./form/fellowships": {
49
+ "types": "./dist/form/fellowships.d.ts",
50
+ "import": "./dist/form/fellowships.js"
51
+ },
52
+ "./form/files": {
53
+ "types": "./dist/form/files.d.ts",
54
+ "import": "./dist/form/files.js"
55
+ },
56
+ "./form/mailing": {
57
+ "types": "./dist/form/mailing.d.ts",
58
+ "import": "./dist/form/mailing.js"
59
+ },
60
+ "./form/news": {
61
+ "types": "./dist/form/news.d.ts",
62
+ "import": "./dist/form/news.js"
63
+ },
64
+ "./form/people": {
65
+ "types": "./dist/form/people.d.ts",
66
+ "import": "./dist/form/people.js"
67
+ },
68
+ "./form/projects": {
69
+ "types": "./dist/form/projects.d.ts",
70
+ "import": "./dist/form/projects.js"
71
+ },
72
+ "./form/publications": {
73
+ "types": "./dist/form/publications.d.ts",
74
+ "import": "./dist/form/publications.js"
75
+ },
76
+ "./form/tags": {
77
+ "types": "./dist/form/tags.d.ts",
78
+ "import": "./dist/form/tags.js"
79
+ },
80
+ "./form/users": {
81
+ "types": "./dist/form/users.d.ts",
82
+ "import": "./dist/form/users.js"
83
+ },
84
+ "./list/actions": {
85
+ "types": "./dist/list/actions.d.ts",
86
+ "import": "./dist/list/actions.js"
87
+ },
88
+ "./list/affiliations": {
89
+ "types": "./dist/list/affiliations.d.ts",
90
+ "import": "./dist/list/affiliations.js"
91
+ },
92
+ "./list/apps": {
93
+ "types": "./dist/list/apps.d.ts",
94
+ "import": "./dist/list/apps.js"
95
+ },
96
+ "./list/disciplines": {
97
+ "types": "./dist/list/disciplines.d.ts",
98
+ "import": "./dist/list/disciplines.js"
99
+ },
100
+ "./list/events": {
101
+ "types": "./dist/list/events.d.ts",
102
+ "import": "./dist/list/events.js"
103
+ },
104
+ "./list/fellowships": {
105
+ "types": "./dist/list/fellowships.d.ts",
106
+ "import": "./dist/list/fellowships.js"
107
+ },
108
+ "./list/files": {
109
+ "types": "./dist/list/files.d.ts",
110
+ "import": "./dist/list/files.js"
111
+ },
112
+ "./list/mailing": {
113
+ "types": "./dist/list/mailing.d.ts",
114
+ "import": "./dist/list/mailing.js"
115
+ },
116
+ "./list/news": {
117
+ "types": "./dist/list/news.d.ts",
118
+ "import": "./dist/list/news.js"
119
+ },
120
+ "./list/people": {
121
+ "types": "./dist/list/people.d.ts",
122
+ "import": "./dist/list/people.js"
123
+ },
124
+ "./list/projects": {
125
+ "types": "./dist/list/projects.d.ts",
126
+ "import": "./dist/list/projects.js"
127
+ },
128
+ "./list/publications": {
129
+ "types": "./dist/list/publications.d.ts",
130
+ "import": "./dist/list/publications.js"
131
+ },
132
+ "./list/tags": {
133
+ "types": "./dist/list/tags.d.ts",
134
+ "import": "./dist/list/tags.js"
135
+ },
136
+ "./list/users": {
137
+ "types": "./dist/list/users.d.ts",
138
+ "import": "./dist/list/users.js"
139
+ },
140
+ "./graphql/client/actions": "./dist/graphql/client/actions/*.gql",
141
+ "./graphql/client/affiliations": "./dist/graphql/client/affiliations/*.gql",
142
+ "./graphql/client/apps": "./dist/graphql/client/apps/*.gql",
143
+ "./graphql/client/events": "./dist/graphql/client/events/*.gql",
144
+ "./graphql/client/fellowships": "./dist/graphql/client/fellowships/*.gql",
145
+ "./graphql/client/files": "./dist/graphql/client/files/*.gql",
146
+ "./graphql/client/mailing": "./dist/graphql/client/mailing/*.gql",
147
+ "./graphql/client/misc": "./dist/graphql/client/misc/*.gql",
148
+ "./graphql/client/news": "./dist/graphql/client/news/*.gql",
149
+ "./graphql/client/people": "./dist/graphql/client/people/*.gql",
150
+ "./graphql/client/projects": "./dist/graphql/client/projects/*.gql",
151
+ "./graphql/client/publications": "./dist/graphql/client/publications/*.gql",
152
+ "./graphql/schemas/apex": "./dist/graphql/schemas/schema.apex.graphql",
153
+ "./graphql/schemas/apex-resolvers": "./dist/graphql/schemas/apex-resolvers-list.json",
154
+ "./graphql/schemas/website": "./dist/graphql/schemas/schema.website.graphql",
155
+ "./graphql/schemas/website-resolvers": "./dist/graphql/schemas/website-resolvers-list.json",
156
+ "./package.json": "./package.json"
157
+ },
158
+ "files": [
159
+ "index.js",
160
+ "index.d.ts",
161
+ "dist/**/*.js",
162
+ "dist/**/*.d.ts",
163
+ "dist/**/*.gql",
164
+ "dist/**/*.graphql",
165
+ "dist/**/*.json",
166
+ "README.md",
167
+ "LICENSE"
168
+ ],
6
169
  "scripts": {
7
170
  "dev": "tsx index.ts",
8
- "generate": "npx tsx lib/generateAll.ts",
171
+ "build": "npx tsx lib/generateAll.ts",
172
+ "build:types": "tsc --emitDeclarationOnly",
9
173
  "generate:modules": "npx tsx lib/generate.ts",
10
174
  "generate:schemas": "npx tsx lib/buildSchemas.ts",
11
175
  "generate:client": "npx tsx lib/buildClientGraphQL.ts",
12
176
  "draw": "npx depcruise src --include-only \"^src\" --output-type dot | dot -T svg > dependency-graph.svg",
13
177
  "clean": "rm -rf dist/",
14
- "prebuild": "npm run clean"
178
+ "prebuild": "npm run clean",
179
+ "prepublishOnly": "npm run build"
15
180
  },
16
- "files": [
17
- "index.ts",
18
- "src/**",
19
- "lib/**",
20
- "dist/**"
21
- ],
22
- "author": "Antoine Cordelois, Paris Institute for Advanced Study",
23
- "license": "ISC",
24
- "description": "Type definitions and schema generator for Paris IAS data management system",
25
181
  "dependencies": {
26
- "ts-node": "^10.9.2",
27
182
  "@graphql-tools/load-files": "^7",
28
183
  "@graphql-tools/merge": "^8",
29
184
  "graphql": "^16"
30
185
  },
31
186
  "devDependencies": {
32
- "dependency-cruiser": "^16.10.0"
187
+ "@types/node": "^24.7.2",
188
+ "dependency-cruiser": "^16.10.0",
189
+ "ts-node": "^10.9.2",
190
+ "tsx": "^4.0.0",
191
+ "typescript": "^5.0.0"
33
192
  }
34
193
  }
package/readme.md CHANGED
@@ -136,7 +136,7 @@ import("@paris-ias/trees/dist/graphql/client/people/query.get.people.gql")
136
136
 
137
137
  ```bash
138
138
  # Using npm
139
- npm install @paris-ias/trees
139
+ npm install @paris-ias/treessss
140
140
 
141
141
  # Using yarn
142
142
  yarn add @paris-ias/trees
package/index.ts DELETED
@@ -1,63 +0,0 @@
1
- import events from "./dist/events"
2
- import news from "./dist/news"
3
- import people from "./dist/people"
4
- import projects from "./dist/projects"
5
- import fellowships from "./dist/fellowships"
6
- import publications from "./dist/publications"
7
- import workExperience from "./dist/workExperience"
8
- import listEvents from "./dist/list/events"
9
- import listNews from "./dist/list/news"
10
- import listPeople from "./dist/list/people"
11
- import listProjects from "./dist/list/projects"
12
- import listFellowships from "./dist/list/fellowships"
13
- import listPublications from "./dist/list/publications"
14
- import listApps from "./dist/list/apps"
15
- import listExperiences from "./dist/list/workExperience"
16
- import formEvents from "./dist/form/events"
17
- import formNews from "./dist/form/news"
18
- import formPeople from "./dist/form/people"
19
- import formProjects from "./dist/form/projects"
20
- import formFellowships from "./dist/form/fellowships"
21
- import formPublications from "./dist/form/publications"
22
- import formApps from "./dist/form/apps"
23
- import formExperiences from "./dist/form/workExperience"
24
- import apps from "./dist/apps"
25
- import {
26
- templates,
27
- ConfigValue,
28
- Form,
29
- Model,
30
- ModuleType,
31
- Sort,
32
- Views,
33
- formType,
34
- } from "./src"
35
-
36
- export {
37
- templates,
38
- apps,
39
- events,
40
- news,
41
- people,
42
- projects,
43
- fellowships,
44
- publications,
45
- workExperience,
46
- listEvents,
47
- listNews,
48
- listPeople,
49
- listProjects,
50
- listFellowships,
51
- listPublications,
52
- listApps,
53
- listExperiences,
54
- formEvents,
55
- formNews,
56
- formPeople,
57
- formProjects,
58
- formFellowships,
59
- formPublications,
60
- formApps,
61
- formExperiences,
62
- }
63
- export type { Form, Sort, Views, ConfigValue, Model, ModuleType, formType }
package/lib/README.md DELETED
@@ -1,206 +0,0 @@
1
- # Type Generation Scripts
2
-
3
- This directory contains scripts for generating type definitions, schemas, and GraphQL client files for the Paris IAS data management system.
4
-
5
- ## Overview
6
-
7
- The generation process consists of three main tasks:
8
-
9
- 1. **Module Generation** (`generate.ts`) - Creates type modules and configurations
10
- 2. **Schema Generation** (`buildSchemas.ts`) - Builds GraphQL schemas and resolver lists
11
- 3. **GraphQL Client Generation** (`buildClientGraphQL.ts`) - Copies and organizes client GraphQL files
12
-
13
- ## Unified Generation
14
-
15
- ### Main Command
16
- ```bash
17
- npm run generate
18
- ```
19
-
20
- This runs the unified generation script (`generateAll.ts`) that orchestrates all three tasks and provides a single consolidated overview instead of three separate outputs.
21
-
22
- ### Individual Commands
23
- If you need to run specific tasks:
24
-
25
- ```bash
26
- npm run generate:modules # Module generation only
27
- npm run generate:schemas # Schema generation only
28
- npm run generate:client # GraphQL client generation only
29
- ```
30
-
31
- ## Generated Output
32
-
33
- The unified generation provides a clean summary:
34
-
35
- ```
36
- ============================================================
37
- 📊 GENERATION SUMMARY
38
- ============================================================
39
- 🕐 Total Duration: 3001ms
40
- 📈 Success Rate: 3/3 tasks completed
41
-
42
- ✅ Completed Tasks:
43
- • Generate Modules: 14/14 modules (1215ms)
44
- • Generate Schemas: 2 schemas + resolvers (1026ms)
45
- • Generate GraphQL Client: 31 files, 12 types (760ms)
46
-
47
- 🎉 All generation tasks completed successfully!
48
- ============================================================
49
- ```
50
-
51
- ## Generated Structure
52
-
53
- After running the generation, the following structure is created:
54
-
55
- ```
56
- dist/
57
- ├── form/ # Module form configurations
58
- ├── list/ # Module list configurations
59
- ├── graphql/
60
- │ ├── schemas/ # Generated GraphQL schemas
61
- │ │ ├── schema.website.graphql
62
- │ │ ├── schema.apex.graphql
63
- │ │ ├── website-resolvers-list.json
64
- │ │ └── apex-resolvers-list.json
65
- │ └── client/ # GraphQL client operations (minimal output)
66
- │ ├── action/
67
- │ │ ├── query.get.action.gql
68
- │ │ └── query.list.action.gql
69
- │ ├── publications/
70
- │ │ ├── query.get.publications.gql
71
- │ │ └── query.list.publications.gql
72
- │ └── ... (other types)
73
- ```
74
-
75
- **Note**: Only `.gql` files are generated since client applications import them directly.
76
-
77
- ---
78
-
79
- # GraphQL Client Builder
80
-
81
- This directory contains the `buildClientGraphQL.ts` script that automatically copies and organizes all GraphQL client operations from the source directories to the distribution folder.
82
-
83
- ## Overview
84
-
85
- The script processes all GraphQL client files located in `src/[type]/graphql/client/` directories and copies them to `dist/graphql/client/[type]/` with proper TypeScript support.
86
-
87
- ## Features
88
-
89
- - **Automatic Discovery**: Finds all `.gql` and `.graphql` files in client directories
90
- - **Organized Structure**: Maintains type-based organization in the dist folder
91
- - **Minimal Output**: Only copies essential `.gql` files (no unnecessary TypeScript files)
92
- - **Direct Import Ready**: Optimized for direct `.gql` file imports in client applications
93
- - **Operation Detection**: Identifies query, mutation, and subscription operations
94
-
95
- ## Usage
96
-
97
- ### Build Script
98
- ```bash
99
- npm run build:client-graphql
100
- ```
101
-
102
- ### Manual Execution
103
- ```bash
104
- npx tsx lib/buildClientGraphQL.ts
105
- ```
106
-
107
- ### Programmatic Usage
108
- ```typescript
109
- import { buildClientGraphQL } from './lib/buildClientGraphQL.ts'
110
-
111
- // Use default configuration
112
- buildClientGraphQL()
113
-
114
- // Use custom configuration
115
- buildClientGraphQL({
116
- srcDir: './custom/src',
117
- distDir: './custom/dist',
118
- extensions: ['.gql'],
119
- generateDeclarations: false
120
- })
121
- ```
122
-
123
- ## Generated Structure
124
-
125
- After running the script, the following structure is created:
126
-
127
- ```
128
- dist/graphql/client/
129
- ├── index.ts # Main export file
130
- ├── action/
131
- │ ├── index.ts # Action type exports
132
- │ ├── query.get.action.gql
133
- │ ├── query.get.action.d.ts
134
- │ └── ...
135
- ├── publications/
136
- │ ├── index.ts # Publications type exports
137
- │ ├── query.get.publications.gql
138
- │ ├── query.get.publications.d.ts
139
- │ └── ...
140
- └── ... (other types)
141
- ```
142
-
143
- ## Client Usage
144
-
145
- Once built, client applications can import GraphQL operations like this:
146
-
147
- ```typescript
148
- // Import specific operations
149
- import { GET_PUBLICATIONS, LIST_PUBLICATIONS } from '@paris-ias/data/dist/graphql/client/publications'
150
-
151
- // Import all operations for a type
152
- import * as publicationsQueries from '@paris-ias/data/dist/graphql/client/publications'
153
-
154
- // Import all operations
155
- import * as graphqlClient from '@paris-ias/data/dist/graphql/client'
156
-
157
- // Use with Apollo Client, Relay, or other GraphQL clients
158
- const client = new ApolloClient({...})
159
- const result = await client.query({
160
- query: GET_PUBLICATIONS,
161
- variables: { appId: 'iea', itemId: '123' }
162
- })
163
- ```
164
-
165
- ## Configuration Options
166
-
167
- | Option | Type | Default | Description |
168
- |--------|------|---------|-------------|
169
- | `srcDir` | string | `../src` | Source directory containing type folders |
170
- | `distDir` | string | `../dist/graphql/client` | Destination directory for built files |
171
- | `extensions` | string[] | `['.gql', '.graphql']` | File extensions to process |
172
- | `generateDeclarations` | boolean | `false` | Whether to generate TypeScript declaration files (disabled for direct .gql imports) |
173
- | `generateIndexFiles` | boolean | `false` | Whether to generate TypeScript index files (disabled for direct .gql imports) |
174
-
175
- ## Integration with Build Process
176
-
177
- The script is integrated into the main build process:
178
-
179
- 1. `npm run clean` - Removes the dist directory
180
- 2. `npm run generate` - Generates type definitions and schemas
181
- 3. `npm run build:client-graphql` - Builds GraphQL client files
182
- 4. `npm run build` - Runs all build steps
183
-
184
- ## File Naming Conventions
185
-
186
- The script recognizes the following naming patterns:
187
- - `query.*` - GraphQL queries
188
- - `mutation.*` or `*.mutations.*` - GraphQL mutations
189
- - `subscription.*` - GraphQL subscriptions
190
-
191
- ## Error Handling
192
-
193
- The script includes comprehensive error handling:
194
- - Missing directories are reported but don't stop the build
195
- - File copy errors are logged and re-thrown
196
- - TypeScript declaration generation errors are handled gracefully
197
-
198
- ## Development
199
-
200
- To modify the build process:
201
-
202
- 1. Edit `lib/buildClientGraphQL.ts`
203
- 2. Test with `npm run build:client-graphql`
204
- 3. Check the generated files in `dist/graphql/client/`
205
-
206
- The script is designed to be extensible and can be modified to support additional file types, custom transformations, or different organization patterns.