@tailor-platform/create-sdk 0.0.1 → 0.8.1

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 (53) hide show
  1. package/CHANGELOG.md +448 -0
  2. package/LICENSE +21 -0
  3. package/README.md +23 -33
  4. package/dist/index.js +180 -0
  5. package/package.json +41 -8
  6. package/templates/hello-world/.gitignore +3 -0
  7. package/templates/hello-world/.prettierignore +1 -0
  8. package/templates/hello-world/.prettierrc +1 -0
  9. package/templates/hello-world/README.md +59 -0
  10. package/templates/hello-world/eslint.config.js +27 -0
  11. package/templates/hello-world/package.json +22 -0
  12. package/templates/hello-world/src/resolvers/hello.ts +19 -0
  13. package/templates/hello-world/tailor.config.ts +6 -0
  14. package/templates/hello-world/tsconfig.json +15 -0
  15. package/templates/inventory-management/.gitignore +3 -0
  16. package/templates/inventory-management/.prettierignore +2 -0
  17. package/templates/inventory-management/.prettierrc +1 -0
  18. package/templates/inventory-management/README.md +246 -0
  19. package/templates/inventory-management/eslint.config.js +33 -0
  20. package/templates/inventory-management/package.json +28 -0
  21. package/templates/inventory-management/src/db/category.ts +13 -0
  22. package/templates/inventory-management/src/db/common/permission.ts +59 -0
  23. package/templates/inventory-management/src/db/contact.ts +17 -0
  24. package/templates/inventory-management/src/db/inventory.ts +18 -0
  25. package/templates/inventory-management/src/db/notification.ts +21 -0
  26. package/templates/inventory-management/src/db/order.ts +20 -0
  27. package/templates/inventory-management/src/db/orderItem.ts +36 -0
  28. package/templates/inventory-management/src/db/product.ts +18 -0
  29. package/templates/inventory-management/src/db/user.ts +12 -0
  30. package/templates/inventory-management/src/executor/checkInventory.ts +28 -0
  31. package/templates/inventory-management/src/generated/kysely-tailordb.ts +92 -0
  32. package/templates/inventory-management/src/pipeline/registerOrder.ts +100 -0
  33. package/templates/inventory-management/tailor.config.ts +35 -0
  34. package/templates/inventory-management/tsconfig.json +16 -0
  35. package/templates/testing/.gitignore +3 -0
  36. package/templates/testing/.prettierignore +2 -0
  37. package/templates/testing/.prettierrc +1 -0
  38. package/templates/testing/README.md +130 -0
  39. package/templates/testing/e2e/globalSetup.ts +65 -0
  40. package/templates/testing/e2e/resolver.test.ts +57 -0
  41. package/templates/testing/eslint.config.js +27 -0
  42. package/templates/testing/package.json +33 -0
  43. package/templates/testing/src/db/user.ts +22 -0
  44. package/templates/testing/src/generated/db.ts +28 -0
  45. package/templates/testing/src/resolver/mockTailordb.test.ts +71 -0
  46. package/templates/testing/src/resolver/mockTailordb.ts +44 -0
  47. package/templates/testing/src/resolver/simple.test.ts +13 -0
  48. package/templates/testing/src/resolver/simple.ts +16 -0
  49. package/templates/testing/src/resolver/wrapTailordb.test.ts +53 -0
  50. package/templates/testing/src/resolver/wrapTailordb.ts +80 -0
  51. package/templates/testing/tailor.config.ts +23 -0
  52. package/templates/testing/tsconfig.json +16 -0
  53. package/templates/testing/vitest.config.ts +22 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,448 @@
1
+ # @tailor-platform/create-sdk
2
+
3
+ ## 0.8.1
4
+
5
+ ## 0.8.0
6
+
7
+ ### Minor Changes
8
+
9
+ - [#3](https://github.com/tailor-platform/sdk/pull/3) [`b9c3dba`](https://github.com/tailor-platform/sdk/commit/b9c3dbaa4b1df4beb27f5b1da7fe23a83a278637) Thanks [@toiroakr](https://github.com/toiroakr)! - chore!: rename tailor-sdk to sdk
10
+
11
+ ## 0.7.6
12
+
13
+ ## 0.7.5
14
+
15
+ ## 0.7.4
16
+
17
+ ## 0.7.3
18
+
19
+ ## 0.7.2
20
+
21
+ ## 0.7.1
22
+
23
+ ## 0.7.0
24
+
25
+ ## 0.6.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#701](https://github.com/tailor-platform/sdk/pull/701) [`1d9e798`](https://github.com/tailor-platform/sdk/commit/1d9e798c667e75734da9b9119770442ce62a48ac) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: seed generator
30
+
31
+ ## 0.6.1
32
+
33
+ ## 0.6.0
34
+
35
+ ## 0.5.6
36
+
37
+ ### Patch Changes
38
+
39
+ - [#691](https://github.com/tailor-platform/sdk/pull/691) [`4e949b6`](https://github.com/tailor-platform/sdk/commit/4e949b67291ce8775c189a793a99f768ab8904db) Thanks [@toiroakr](https://github.com/toiroakr)! - feat: add seed generator
40
+
41
+ Added `@tailor-platform/seed` generator that automatically generates seed data files from TailorDB type definitions. This generator creates:
42
+ - GraphQL Ingest mapping files (`mappings/*.json`) and GraphQL files for bulk data loading via [gql-ingest](https://github.com/jackchuka/gql-ingest)
43
+ - lines-db schema files (`data/*.schema.ts`) for validation via [lines-db](https://github.com/toiroakr/lines-db)
44
+ - Configuration file (`config.yaml`) defining entity dependencies
45
+
46
+ **Usage:**
47
+
48
+ ```typescript
49
+ import { defineGenerators } from "@tailor-platform/sdk";
50
+
51
+ export const generators = defineGenerators([
52
+ ["@tailor-platform/seed", { distPath: "./seed" }],
53
+ ]);
54
+ ```
55
+
56
+ This will generate seed data infrastructure based on your TailorDB types, enabling validation with [`lines-db`](https://github.com/toiroakr/lines-db) and data ingestion with [`gql-ingest`](https://github.com/jackchuka/gql-ingest).
57
+
58
+ ## 0.5.5
59
+
60
+ ## 0.5.4
61
+
62
+ ### Patch Changes
63
+
64
+ - [#682](https://github.com/tailor-platform/sdk/pull/682) [`7678f09`](https://github.com/tailor-platform/sdk/commit/7678f09909e4d604604e8845d39e86be3e7fa47a) Thanks [@remiposo](https://github.com/remiposo)! - Renamed from Tailor SDK to Tailor Platform SDK
65
+
66
+ ## 0.5.3
67
+
68
+ ### Patch Changes
69
+
70
+ - [#680](https://github.com/tailor-platform/sdk/pull/680) [`4550297`](https://github.com/tailor-platform/sdk/commit/455029768e43a9d9bffbae0b93fdabd75e905a53) Thanks [@remiposo](https://github.com/remiposo)! - Added @tailor-platform/function-types to testing
71
+
72
+ ## 0.5.2
73
+
74
+ ### Patch Changes
75
+
76
+ - [#675](https://github.com/tailor-platform/sdk/pull/675) [`8cb1c77`](https://github.com/tailor-platform/sdk/commit/8cb1c77582da17f7fa4171ea15fe4d5aa465a9bd) Thanks [@remiposo](https://github.com/remiposo)! - Added testing guides
77
+
78
+ ## 0.5.1
79
+
80
+ ## 0.5.0
81
+
82
+ ## 0.4.0
83
+
84
+ ### Minor Changes
85
+
86
+ - [#665](https://github.com/tailor-platform/sdk/pull/665) [`16e7cf2`](https://github.com/tailor-platform/sdk/commit/16e7cf2045cfa7dff717ce9001a2925cd5588d5f) Thanks [@toiroakr](https://github.com/toiroakr)! - chore!: rename pipeline -> resolver
87
+
88
+ ## 0.3.0
89
+
90
+ ### Minor Changes
91
+
92
+ - [#661](https://github.com/tailor-platform/sdk/pull/661) [`bf4583c`](https://github.com/tailor-platform/sdk/commit/bf4583cef16bcc7b88118d2814b2beec28b825dd) Thanks [@t](https://github.com/t)! - feat!: remove TailorType and set typename for resolver
93
+
94
+ ## Breaking Changes
95
+
96
+ ### Removed `t.type()` - use plain objects for input and `t.object()` for output
97
+
98
+ The `t.type()` wrapper has been removed from resolver definitions. Input fields are now passed directly as an object, and output uses `t.object()` instead.
99
+
100
+ **Before:**
101
+
102
+ ```typescript
103
+ createResolver({
104
+ name: "add",
105
+ operation: "query",
106
+ input: t.type({
107
+ a: t.int(),
108
+ b: t.int(),
109
+ }),
110
+ output: t.type({
111
+ result: t.int(),
112
+ }),
113
+ body: (context) => {
114
+ return { result: context.input.a + context.input.b };
115
+ },
116
+ });
117
+ ```
118
+
119
+ **After:**
120
+
121
+ ```typescript
122
+ createResolver({
123
+ name: "add",
124
+ operation: "query",
125
+ input: {
126
+ a: t.int(),
127
+ b: t.int(),
128
+ },
129
+ output: t.object({
130
+ result: t.int(),
131
+ }),
132
+ body: (context) => {
133
+ return { result: context.input.a + context.input.b };
134
+ },
135
+ });
136
+ ```
137
+
138
+ ## New Feature
139
+
140
+ ### Added `typeName()` method for custom GraphQL type names
141
+
142
+ You can now set custom GraphQL type names for enum and nested object fields using the `.typeName()` method. This is useful when you want to control the generated GraphQL type names.
143
+
144
+ ```typescript
145
+ createResolver({
146
+ name: "stepChain",
147
+ operation: "query",
148
+ input: {
149
+
150
+ .object({
151
+ name: t.object({
152
+ first: t.string(),
153
+ last: t.string(),
154
+ }),
155
+ activatedAt: t.datetime({ optional: true }),
156
+ })
157
+ .typeName("StepChainUser"),
158
+ },
159
+ output: t.object({
160
+ result: t.string(),
161
+ }),
162
+ body: (context) => {
163
+ return {
164
+ result: `${context.input.user.name.first} ${context.input.user.name.last}`,
165
+ };
166
+ },
167
+ });
168
+ ```
169
+
170
+ ## 0.2.1
171
+
172
+ ## 0.2.0
173
+
174
+ ## 0.1.1
175
+
176
+ ## 0.1.0
177
+
178
+ ### Minor Changes
179
+
180
+ - [#643](https://github.com/tailor-platform/sdk/pull/643) [`793a792`](https://github.com/tailor-platform/sdk/commit/793a7924bd6df4b5c23c5747e1935772ada0c152) Thanks [@toiroakr](https://github.com/toiroakr)! - feat!: remove assertNonNull option
181
+
182
+ ## Breaking Changes
183
+
184
+ ### Removed `assertNonNull` option from field definitions
185
+
186
+ The `assertNonNull` option has been removed from field configurations. This option was previously used with `.hooks()` to ensure fields always return non-null values in resolver outputs, even when marked as `optional: true`.
187
+
188
+ **Before:**
189
+
190
+ ```typescript
191
+ const model = db.type("Model", {
192
+ field: db.string({ optional: true, assertNonNull: true }).hooks({
193
+ create: () => "default-value",
194
+ }),
195
+ });
196
+ ```
197
+
198
+ **After:**
199
+
200
+ ```typescript
201
+ const model = db.type("Model", {
202
+ field: db.string().hooks({
203
+ create: () => "default-value",
204
+ }),
205
+ });
206
+ ```
207
+
208
+ When you use `.hooks()` with a `create` hook that always provides a value, the field should be defined as non-nullable (without `optional: true`).
209
+
210
+ ### Serial fields must be non-nullable
211
+
212
+ The `.serial()` method can now only be used on non-nullable fields. If you were using `serial()` with `optional: true`, you must remove the `optional: true` option.
213
+
214
+ **Before:**
215
+
216
+ ```typescript
217
+ const invoice = db.type("Invoice", {
218
+ invoiceNumber: db.string({ optional: true }).serial({
219
+ start: 1000,
220
+ format: "INV-%05d",
221
+ }),
222
+ });
223
+ ```
224
+
225
+ **After:**
226
+
227
+ ```typescript
228
+ const invoice = db.type("Invoice", {
229
+ invoiceNumber: db.string().serial({
230
+ start: 1000,
231
+ format: "INV-%05d",
232
+ }),
233
+ });
234
+ ```
235
+
236
+ ### Hook function argument types
237
+
238
+ The `data` parameter in hook functions now treats all fields as optional (`T | null | undefined`), regardless of whether they are required in the schema.
239
+
240
+ **Before:**
241
+
242
+ ```typescript
243
+ fullAddress: db.string({ optional: true }).hooks({
244
+ create: ({ data }) => `${data.postalCode} ${data.address} ${data.city}`,
245
+ // data.postalCode was guaranteed to be present
246
+ });
247
+ ```
248
+
249
+ **After:**
250
+
251
+ ```typescript
252
+ fullAddress: db.string({ optional: true }).hooks({
253
+ create: ({ data }) =>
254
+ `${data.postalCode ?? ""} ${data.address ?? ""} ${data.city ?? ""}`,
255
+ // All fields may be undefined - use ?? or add null checks
256
+ });
257
+ ```
258
+
259
+ ## 0.0.99
260
+
261
+ ## 0.0.98
262
+
263
+ ## 0.0.97
264
+
265
+ ## 0.0.96
266
+
267
+ ## 0.0.95
268
+
269
+ ### Patch Changes
270
+
271
+ - [#627](https://github.com/tailor-platform/sdk/pull/627) [`6582379`](https://github.com/tailor-platform/sdk/commit/6582379d81c7d5469e27d672c9313a1cb9b81c50) Thanks [@toiroakr](https://github.com/toiroakr)! - feat!: unnest resolver input type
272
+
273
+ ## Breaking Changes
274
+
275
+ The structure of resolver input arguments in GraphQL queries/mutations has changed. Previously, all input fields were nested under a single `input` argument, but now they are passed as flat, top-level arguments.
276
+
277
+ ### Migration Guide
278
+
279
+ You have two migration options:
280
+
281
+ #### Option 1: Update GraphQL queries
282
+
283
+ Update your GraphQL queries to pass arguments as flat parameters.
284
+
285
+ **Before:**
286
+
287
+ ```gql
288
+ query {
289
+ add(input: { a: 1, b: 2 }) {
290
+ result
291
+ }
292
+ }
293
+ ```
294
+
295
+ **After:**
296
+
297
+ ```gql
298
+ query {
299
+ add(a: 1, b: 2) {
300
+ result
301
+ }
302
+ }
303
+ ```
304
+
305
+ #### Option 2: Wrap input type to maintain existing GraphQL API
306
+
307
+ If you need to maintain backward compatibility with existing GraphQL queries, wrap your input type in a single `input` field:
308
+
309
+ ```typescript
310
+ createResolver({
311
+ name: "add",
312
+ operation: "query",
313
+ input: t.type({
314
+ input: t.object({
315
+ a: t.int(),
316
+ b: t.int(),
317
+ }),
318
+ }),
319
+ body: (context) => {
320
+ return { result: context.input.input.a + context.input.input.b };
321
+ },
322
+ output: t.type({ result: t.int() }),
323
+ });
324
+ ```
325
+
326
+ This way, your existing GraphQL queries with `add(input: { a: 1, b: 2 })` will continue to work.
327
+
328
+ ## 0.0.94
329
+
330
+ ## 0.0.93
331
+
332
+ ### Patch Changes
333
+
334
+ - [#617](https://github.com/tailor-platform/sdk/pull/617) [`d45fe83`](https://github.com/tailor-platform/sdk/commit/d45fe834398426c94e5239e9bc94a5736df87016) Thanks [@toiroakr](https://github.com/toiroakr)! - feat: add tailordb.Client mock for apply
335
+
336
+ ## 0.0.92
337
+
338
+ ### Patch Changes
339
+
340
+ - [#607](https://github.com/tailor-platform/sdk/pull/607) [`ab2cadd`](https://github.com/tailor-platform/sdk/commit/ab2cadd9f92ac488ae1963d0768e2ca96ec66e0f) Thanks [@toiroakr](https://github.com/toiroakr)! - refactor: move inflection to out of configuration
341
+
342
+ ## 0.0.91
343
+
344
+ ### Patch Changes
345
+
346
+ - [#606](https://github.com/tailor-platform/sdk/pull/606) [`f1be4bf`](https://github.com/tailor-platform/sdk/commit/f1be4bf0f324e5ea1896fa4c1a9415b48eb0b134) Thanks [@toiroakr](https://github.com/toiroakr)! - feat!: kysely-db generator renewal
347
+
348
+ ## 0.0.90
349
+
350
+ ### Patch Changes
351
+
352
+ - [#598](https://github.com/tailor-platform/sdk/pull/598) [`7b2ffaf`](https://github.com/tailor-platform/sdk/commit/7b2ffaf47b8f324bf489c7734f566be320dd69cc) Thanks [@toiroakr](https://github.com/toiroakr)! - chore: improve url schema
353
+
354
+ - [#600](https://github.com/tailor-platform/sdk/pull/600) [`ec16341`](https://github.com/tailor-platform/sdk/commit/ec16341c0d5aaf5c786f03216ab5642ff4fe7683) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: remove callbackUrl from defineStaticWebsite
355
+
356
+ ## 0.0.89
357
+
358
+ ### Patch Changes
359
+
360
+ - [#597](https://github.com/tailor-platform/sdk/pull/597) [`36ea41c`](https://github.com/tailor-platform/sdk/commit/36ea41c4fea9c4d6ff4b5b1d7fd8582ceae09c89) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: stricter define function types
361
+
362
+ - [#595](https://github.com/tailor-platform/sdk/pull/595) [`2d3f019`](https://github.com/tailor-platform/sdk/commit/2d3f01977bcf271a8874fc5f6d273d6c1c1561f8) Thanks [@toiroakr](https://github.com/toiroakr)! - feat: add defineIdp
363
+
364
+ ## 0.0.88
365
+
366
+ ### Patch Changes
367
+
368
+ - [#594](https://github.com/tailor-platform/sdk/pull/594) [`ac244cd`](https://github.com/tailor-platform/sdk/commit/ac244cd7769cfe92a962ea48918559dd403991df) Thanks [@toiroakr](https://github.com/toiroakr)! - feat: add defineStaticWebsite
369
+
370
+ - [#589](https://github.com/tailor-platform/sdk/pull/589) [`5195548`](https://github.com/tailor-platform/sdk/commit/5195548158aa61fe7b33a75a4812d5345adde3da) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: type guard for workspaceId
371
+
372
+ ## 0.0.87
373
+
374
+ ### Patch Changes
375
+
376
+ - [#585](https://github.com/tailor-platform/sdk/pull/585) [`3f13d44`](https://github.com/tailor-platform/sdk/commit/3f13d4463047862cfe438f71d87629e49320c6eb) Thanks [@toiroakr](https://github.com/toiroakr)! - chore: update resolver schema
377
+
378
+ ## 0.0.86
379
+
380
+ ### Patch Changes
381
+
382
+ - [#575](https://github.com/tailor-platform/sdk/pull/575) [`0d64a86`](https://github.com/tailor-platform/sdk/commit/0d64a869766049ffb8462dace6222db53e23dbce) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: strict resolver output type
383
+
384
+ ## 0.0.85
385
+
386
+ ### Patch Changes
387
+
388
+ - [#573](https://github.com/tailor-platform/sdk/pull/573) [`11cae3e`](https://github.com/tailor-platform/sdk/commit/11cae3e8aa89fc8d71993a0bb9e28c02123f185f) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: generated type reference
389
+
390
+ ## 0.0.84
391
+
392
+ ## 0.0.83
393
+
394
+ ### Patch Changes
395
+
396
+ - [#559](https://github.com/tailor-platform/sdk/pull/559) [`ebcb667`](https://github.com/tailor-platform/sdk/commit/ebcb6674bbc1fc3ac819bb0e2930255a660ade1b) Thanks [@toiroakr](https://github.com/toiroakr)! - Remove steps from resolver
397
+
398
+ ## 0.0.82
399
+
400
+ ## 0.0.81
401
+
402
+ ### Patch Changes
403
+
404
+ - [#552](https://github.com/tailor-platform/sdk/pull/552) [`c9f10c5`](https://github.com/tailor-platform/sdk/commit/c9f10c5ca80ebb1e282b3639e2b7a24b4aefba7d) Thanks [@toiroakr](https://github.com/toiroakr)! - Simplified permission definitions with automatic type generation
405
+
406
+ ## 0.0.80
407
+
408
+ ### Patch Changes
409
+
410
+ - [#548](https://github.com/tailor-platform/sdk/pull/548) [`ce834be`](https://github.com/tailor-platform/sdk/commit/ce834bec7c7d80a3f56a520339a569fef9225888) Thanks [@toiroakr](https://github.com/toiroakr)! - kysely-type generator: support assertNonNull
411
+
412
+ ## 0.0.79
413
+
414
+ ### Patch Changes
415
+
416
+ - [#545](https://github.com/tailor-platform/sdk/pull/545) [`e82a038`](https://github.com/tailor-platform/sdk/commit/e82a038b022ebf58dd377a247b7bdf1fa608701c) Thanks [@remiposo](https://github.com/remiposo)! - chore: Add LICENSE
417
+
418
+ ## 0.0.78
419
+
420
+ ## 0.0.77
421
+
422
+ ## 0.0.76
423
+
424
+ ### Patch Changes
425
+
426
+ - [#521](https://github.com/tailor-platform/sdk/pull/521) [`f380645`](https://github.com/tailor-platform/sdk/commit/f3806455815ed4efd80cfe11428bd7862c77b401) Thanks [@remiposo](https://github.com/remiposo)! - chore: Update CHANGELOG.md format
427
+
428
+ ## 0.0.75
429
+
430
+ ### Patch Changes
431
+
432
+ - dca9f5b: Separate generator config from defineConfig
433
+
434
+ ## 0.0.74
435
+
436
+ ## 0.0.73
437
+
438
+ ### Patch Changes
439
+
440
+ - 9be7344: Change defineConfig to be tailored specifically for a single app
441
+
442
+ ## 0.0.72
443
+
444
+ ## 0.0.71
445
+
446
+ ### Patch Changes
447
+
448
+ - 9f7a52c: Add CHANGELOG.md
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2025 Tailor Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,35 @@
1
- # @tailor-platform/create-sdk
1
+ # Create Tailor Platform SDK
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ `@tailor-platform/create-sdk` is a CLI tool to quickly scaffold a new [Tailor Platform SDK](https://www.npmjs.com/package/@tailor-platform/sdk) project.
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ ## Usage
6
6
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
7
+ ```bash
8
+ npm create @tailor-platform/sdk [OPTIONS] [NAME]
9
+ # OR
10
+ yarn create @tailor-platform/sdk [OPTIONS] [NAME]
11
+ # OR
12
+ pnpm create @tailor-platform/sdk [OPTIONS] [NAME]
13
+ ```
8
14
 
9
- ## Purpose
15
+ ### Arguments
10
16
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@tailor-platform/create-sdk`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
17
+ - `NAME`: (Optional) The name of your new project. If not provided, you'll be prompted to enter one.
15
18
 
16
- ## What is OIDC Trusted Publishing?
19
+ ### Options
17
20
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
21
+ - `--template <template-name>`: (Optional) Specify a template to use for your project. If not provided, you'll be prompted to select one from a list of available templates.
19
22
 
20
- ## Setup Instructions
23
+ ## What it does
21
24
 
22
- To properly configure OIDC trusted publishing for this package:
25
+ This tool will:
23
26
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
27
+ 1. Create a new directory with the specified project name.
28
+ 2. Scaffold a new Tailor Platform SDK project in that directory using the selected template.
29
+ 3. Install the necessary dependencies with the package manager being used.
30
+ 4. Initialize a new Git repository in the project directory.
28
31
 
29
- ## DO NOT USE THIS PACKAGE
32
+ ### Note
30
33
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
34
+ - If none of the supported package managers (npm, yarn, pnpm) are found, dependency installation will be skipped.
35
+ - If the project already exists within a git repository, git initialization will be skipped.