create-next-hydra 0.1.0 → 0.2.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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/dist/cli.js +0 -0
  4. package/dist/composition/add.d.ts +14 -0
  5. package/dist/composition/add.d.ts.map +1 -0
  6. package/dist/composition/add.js +453 -0
  7. package/dist/composition/catalog.d.ts +23 -0
  8. package/dist/composition/catalog.d.ts.map +1 -0
  9. package/dist/composition/catalog.js +301 -0
  10. package/dist/composition/errors.d.ts +5 -0
  11. package/dist/composition/errors.d.ts.map +1 -0
  12. package/dist/composition/errors.js +8 -0
  13. package/dist/composition/format.d.ts +6 -0
  14. package/dist/composition/format.d.ts.map +1 -0
  15. package/dist/composition/format.js +63 -0
  16. package/dist/composition/install.d.ts +16 -0
  17. package/dist/composition/install.d.ts.map +1 -0
  18. package/dist/composition/install.js +175 -0
  19. package/dist/composition/packages.d.ts +6 -0
  20. package/dist/composition/packages.d.ts.map +1 -0
  21. package/dist/composition/packages.js +54 -0
  22. package/dist/composition/paths.d.ts +4 -0
  23. package/dist/composition/paths.d.ts.map +1 -0
  24. package/dist/composition/paths.js +47 -0
  25. package/dist/composition/planner.d.ts +4 -0
  26. package/dist/composition/planner.d.ts.map +1 -0
  27. package/dist/composition/planner.js +320 -0
  28. package/dist/composition/schema.d.ts +235 -0
  29. package/dist/composition/schema.d.ts.map +1 -0
  30. package/dist/composition/schema.js +115 -0
  31. package/dist/composition/types.d.ts +87 -0
  32. package/dist/composition/types.d.ts.map +1 -0
  33. package/dist/composition/types.js +6 -0
  34. package/dist/composition/use.d.ts +23 -0
  35. package/dist/composition/use.d.ts.map +1 -0
  36. package/dist/composition/use.js +182 -0
  37. package/dist/composition/workspace.d.ts +10 -0
  38. package/dist/composition/workspace.d.ts.map +1 -0
  39. package/dist/composition/workspace.js +208 -0
  40. package/dist/constants.d.ts +4 -1
  41. package/dist/constants.d.ts.map +1 -1
  42. package/dist/constants.js +26 -1
  43. package/dist/fs-utils.js +3 -3
  44. package/dist/git.d.ts.map +1 -1
  45. package/dist/git.js +12 -12
  46. package/dist/index.d.ts +5 -1
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +55 -6
  49. package/dist/instruction-renderer.d.ts +17 -0
  50. package/dist/instruction-renderer.d.ts.map +1 -0
  51. package/dist/instruction-renderer.js +132 -0
  52. package/dist/logger.d.ts +2 -1
  53. package/dist/logger.d.ts.map +1 -1
  54. package/dist/logger.js +7 -3
  55. package/dist/prompts.d.ts +2 -0
  56. package/dist/prompts.d.ts.map +1 -1
  57. package/dist/prompts.js +25 -2
  58. package/dist/sanitize.d.ts +2 -1
  59. package/dist/sanitize.d.ts.map +1 -1
  60. package/dist/sanitize.js +13 -4
  61. package/dist/scaffold.d.ts +5 -1
  62. package/dist/scaffold.d.ts.map +1 -1
  63. package/dist/scaffold.js +247 -71
  64. package/dist/types.d.ts +5 -0
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/version.d.ts +2 -0
  67. package/dist/version.d.ts.map +1 -0
  68. package/dist/version.js +2 -0
  69. package/package.json +35 -23
  70. package/schema/selection-definition.json +237 -0
  71. package/schema/source-registry.json +37 -0
@@ -0,0 +1,237 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/jakala-na/next-hydra/main/packages/create-next-hydra/schema/selection-definition.json",
4
+ "title": "Next Hydra Selection Definition",
5
+ "description": "A ShadCN registry item containing strict Next Hydra composition metadata.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://ui.shadcn.com/schema/registry-item.json"
9
+ },
10
+ {
11
+ "type": "object",
12
+ "required": ["$schema", "meta"],
13
+ "properties": {
14
+ "$schema": {
15
+ "const": "https://raw.githubusercontent.com/jakala-na/next-hydra/main/packages/create-next-hydra/schema/selection-definition.json"
16
+ },
17
+ "meta": {
18
+ "type": "object",
19
+ "required": ["nextHydra"],
20
+ "properties": {
21
+ "nextHydra": {
22
+ "$ref": "#/$defs/nextHydra"
23
+ }
24
+ },
25
+ "additionalProperties": true
26
+ }
27
+ }
28
+ }
29
+ ],
30
+ "$defs": {
31
+ "workspacePath": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "pattern": "^(?!/)(?!\\.\\.(?:/|$))(?!.*\\/\\.\\.(?:/|$))(?!.*\\\\).+$"
35
+ },
36
+ "workspaceFilePath": {
37
+ "allOf": [
38
+ {
39
+ "$ref": "#/$defs/workspacePath"
40
+ },
41
+ {
42
+ "not": {
43
+ "pattern": "^\\.(?:/+\\.)*/*$"
44
+ }
45
+ }
46
+ ]
47
+ },
48
+ "nextHydra": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["id", "kind"],
52
+ "properties": {
53
+ "id": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ },
57
+ "kind": {
58
+ "enum": ["provider", "add-on", "preset"]
59
+ },
60
+ "slot": {
61
+ "enum": ["auth", "cms", "commerce"]
62
+ },
63
+ "compatibility": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "requires": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "uniqueItems": true
74
+ },
75
+ "conflicts": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ },
81
+ "uniqueItems": true
82
+ }
83
+ }
84
+ },
85
+ "packages": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["cwd", "section", "name", "specifier"],
91
+ "properties": {
92
+ "cwd": {
93
+ "$ref": "#/$defs/workspacePath"
94
+ },
95
+ "section": {
96
+ "enum": [
97
+ "dependencies",
98
+ "devDependencies",
99
+ "optionalDependencies"
100
+ ]
101
+ },
102
+ "name": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ },
106
+ "specifier": {
107
+ "type": "string",
108
+ "minLength": 1
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "pnpmPatches": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["dependency", "path"],
119
+ "properties": {
120
+ "dependency": {
121
+ "type": "string",
122
+ "minLength": 1
123
+ },
124
+ "path": {
125
+ "$ref": "#/$defs/workspaceFilePath"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ "assets": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["source", "target"],
136
+ "properties": {
137
+ "source": {
138
+ "$ref": "#/$defs/workspaceFilePath"
139
+ },
140
+ "target": {
141
+ "$ref": "#/$defs/workspaceFilePath"
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "selections": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "properties": {
150
+ "providers": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "properties": {
154
+ "auth": {
155
+ "type": "string",
156
+ "minLength": 1
157
+ },
158
+ "cms": {
159
+ "type": "string",
160
+ "minLength": 1
161
+ },
162
+ "commerce": {
163
+ "type": "string",
164
+ "minLength": 1
165
+ }
166
+ }
167
+ },
168
+ "addOns": {
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ },
174
+ "uniqueItems": true
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "allOf": [
180
+ {
181
+ "if": {
182
+ "properties": {
183
+ "kind": {
184
+ "const": "provider"
185
+ }
186
+ },
187
+ "required": ["kind"]
188
+ },
189
+ "then": {
190
+ "required": ["slot"],
191
+ "not": {
192
+ "required": ["selections"]
193
+ }
194
+ }
195
+ },
196
+ {
197
+ "if": {
198
+ "properties": {
199
+ "kind": {
200
+ "const": "add-on"
201
+ }
202
+ },
203
+ "required": ["kind"]
204
+ },
205
+ "then": {
206
+ "not": {
207
+ "anyOf": [
208
+ {
209
+ "required": ["slot"]
210
+ },
211
+ {
212
+ "required": ["selections"]
213
+ }
214
+ ]
215
+ }
216
+ }
217
+ },
218
+ {
219
+ "if": {
220
+ "properties": {
221
+ "kind": {
222
+ "const": "preset"
223
+ }
224
+ },
225
+ "required": ["kind"]
226
+ },
227
+ "then": {
228
+ "required": ["selections"],
229
+ "not": {
230
+ "required": ["slot"]
231
+ }
232
+ }
233
+ }
234
+ ]
235
+ }
236
+ }
237
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/jakala-na/next-hydra/main/packages/create-next-hydra/schema/source-registry.json",
4
+ "title": "Next Hydra Source Registry",
5
+ "description": "A ShadCN source registry that applies the Next Hydra Selection Definition schema to items containing meta.nextHydra.",
6
+ "allOf": [
7
+ {
8
+ "$ref": "https://ui.shadcn.com/schema/registry.json"
9
+ },
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "items": {
14
+ "type": "array",
15
+ "items": {
16
+ "if": {
17
+ "type": "object",
18
+ "required": ["meta"],
19
+ "properties": {
20
+ "meta": {
21
+ "type": "object",
22
+ "required": ["nextHydra"]
23
+ }
24
+ }
25
+ },
26
+ "then": {
27
+ "$ref": "https://raw.githubusercontent.com/jakala-na/next-hydra/main/packages/create-next-hydra/schema/selection-definition.json"
28
+ },
29
+ "else": {
30
+ "$ref": "https://ui.shadcn.com/schema/registry-item.json"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ]
37
+ }