@slingr/cli 0.0.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 (144) hide show
  1. package/README.md +320 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/cli-build.d.ts +9 -0
  7. package/dist/commands/cli-build.d.ts.map +1 -0
  8. package/dist/commands/cli-build.js +36 -0
  9. package/dist/commands/cli-build.js.map +1 -0
  10. package/dist/commands/create-app.d.ts +20 -0
  11. package/dist/commands/create-app.d.ts.map +1 -0
  12. package/dist/commands/create-app.js +246 -0
  13. package/dist/commands/create-app.js.map +1 -0
  14. package/dist/commands/ds.d.ts +28 -0
  15. package/dist/commands/ds.d.ts.map +1 -0
  16. package/dist/commands/ds.js +529 -0
  17. package/dist/commands/ds.js.map +1 -0
  18. package/dist/commands/gql.d.ts +22 -0
  19. package/dist/commands/gql.d.ts.map +1 -0
  20. package/dist/commands/gql.js +340 -0
  21. package/dist/commands/gql.js.map +1 -0
  22. package/dist/commands/infra/down.d.ts +13 -0
  23. package/dist/commands/infra/down.d.ts.map +1 -0
  24. package/dist/commands/infra/down.js +80 -0
  25. package/dist/commands/infra/down.js.map +1 -0
  26. package/dist/commands/infra/up.d.ts +13 -0
  27. package/dist/commands/infra/up.d.ts.map +1 -0
  28. package/dist/commands/infra/up.js +69 -0
  29. package/dist/commands/infra/up.js.map +1 -0
  30. package/dist/commands/infra/update.d.ts +14 -0
  31. package/dist/commands/infra/update.d.ts.map +1 -0
  32. package/dist/commands/infra/update.js +321 -0
  33. package/dist/commands/infra/update.js.map +1 -0
  34. package/dist/commands/run.d.ts +19 -0
  35. package/dist/commands/run.d.ts.map +1 -0
  36. package/dist/commands/run.js +315 -0
  37. package/dist/commands/run.js.map +1 -0
  38. package/dist/commands/setup.d.ts +18 -0
  39. package/dist/commands/setup.d.ts.map +1 -0
  40. package/dist/commands/setup.js +189 -0
  41. package/dist/commands/setup.js.map +1 -0
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +8 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/projectStructure.d.ts +10 -0
  47. package/dist/projectStructure.d.ts.map +1 -0
  48. package/dist/projectStructure.js +153 -0
  49. package/dist/projectStructure.js.map +1 -0
  50. package/dist/scripts/generate-schema.d.ts +10 -0
  51. package/dist/scripts/generate-schema.d.ts.map +1 -0
  52. package/dist/scripts/generate-schema.js +130 -0
  53. package/dist/scripts/generate-schema.js.map +1 -0
  54. package/dist/scripts/generate-schema.ts +143 -0
  55. package/dist/templates/.github/copilot-instructions.md.template +17 -0
  56. package/dist/templates/config/datasource.ts.template +9 -0
  57. package/dist/templates/config/jest.config.ts +30 -0
  58. package/dist/templates/config/jest.setup.ts +1 -0
  59. package/dist/templates/config/tsconfig.json.template +30 -0
  60. package/dist/templates/dataSources/mysql.ts.template +13 -0
  61. package/dist/templates/dataSources/postgres.ts.template +13 -0
  62. package/dist/templates/dataset-generator-script.ts.template +140 -0
  63. package/dist/templates/datasets/mysql-default/Address.jsonl.template +4 -0
  64. package/dist/templates/datasets/mysql-default/App.jsonl.template +5 -0
  65. package/dist/templates/datasets/mysql-default/Company.jsonl.template +4 -0
  66. package/dist/templates/datasets/mysql-default/Person.jsonl.template +3 -0
  67. package/dist/templates/datasets/postgres-default/Address.jsonl.template +4 -0
  68. package/dist/templates/datasets/postgres-default/App.jsonl.template +5 -0
  69. package/dist/templates/datasets/postgres-default/Company.jsonl.template +4 -0
  70. package/dist/templates/datasets/postgres-default/Person.jsonl.template +3 -0
  71. package/dist/templates/docs/app-description.md.template +34 -0
  72. package/dist/templates/gql/codegen.yml.template +25 -0
  73. package/dist/templates/gql/index.ts.template +24 -0
  74. package/dist/templates/gql/operations.graphql.template +30 -0
  75. package/dist/templates/package.json.template +38 -0
  76. package/dist/templates/prompt-analysis.md.template +111 -0
  77. package/dist/templates/prompt-script-generation.md.template +259 -0
  78. package/dist/templates/src/Address.ts.template +31 -0
  79. package/dist/templates/src/App.ts.template +61 -0
  80. package/dist/templates/src/Company.ts.template +48 -0
  81. package/dist/templates/src/Models.test.ts.template +655 -0
  82. package/dist/templates/src/Person.test.ts.template +289 -0
  83. package/dist/templates/src/Person.ts.template +105 -0
  84. package/dist/templates/src/actions/index.ts.template +12 -0
  85. package/dist/templates/src/index.ts +66 -0
  86. package/dist/templates/src/types/gql.d.ts.template +18 -0
  87. package/dist/templates/vscode/extensions.json +3 -0
  88. package/dist/templates/vscode/settings.json +11 -0
  89. package/dist/utils/datasourceParser.d.ts +12 -0
  90. package/dist/utils/datasourceParser.d.ts.map +1 -0
  91. package/dist/utils/datasourceParser.js +91 -0
  92. package/dist/utils/datasourceParser.js.map +1 -0
  93. package/dist/utils/jsonlLoader.d.ts +140 -0
  94. package/dist/utils/jsonlLoader.d.ts.map +1 -0
  95. package/dist/utils/jsonlLoader.js +583 -0
  96. package/dist/utils/jsonlLoader.js.map +1 -0
  97. package/dist/utils/model-analyzer.d.ts +86 -0
  98. package/dist/utils/model-analyzer.d.ts.map +1 -0
  99. package/dist/utils/model-analyzer.js +458 -0
  100. package/dist/utils/model-analyzer.js.map +1 -0
  101. package/dist/utils/portChecker.d.ts +36 -0
  102. package/dist/utils/portChecker.d.ts.map +1 -0
  103. package/dist/utils/portChecker.js +308 -0
  104. package/dist/utils/portChecker.js.map +1 -0
  105. package/dist/utils/synthetic-data-generator.d.ts +74 -0
  106. package/dist/utils/synthetic-data-generator.d.ts.map +1 -0
  107. package/dist/utils/synthetic-data-generator.js +443 -0
  108. package/dist/utils/synthetic-data-generator.js.map +1 -0
  109. package/oclif.manifest.json +435 -0
  110. package/package.json +118 -0
  111. package/src/templates/.github/copilot-instructions.md.template +17 -0
  112. package/src/templates/config/datasource.ts.template +9 -0
  113. package/src/templates/config/jest.config.ts +30 -0
  114. package/src/templates/config/jest.setup.ts +1 -0
  115. package/src/templates/config/tsconfig.json.template +30 -0
  116. package/src/templates/dataSources/mysql.ts.template +13 -0
  117. package/src/templates/dataSources/postgres.ts.template +13 -0
  118. package/src/templates/dataset-generator-script.ts.template +140 -0
  119. package/src/templates/datasets/mysql-default/Address.jsonl.template +4 -0
  120. package/src/templates/datasets/mysql-default/App.jsonl.template +5 -0
  121. package/src/templates/datasets/mysql-default/Company.jsonl.template +4 -0
  122. package/src/templates/datasets/mysql-default/Person.jsonl.template +3 -0
  123. package/src/templates/datasets/postgres-default/Address.jsonl.template +4 -0
  124. package/src/templates/datasets/postgres-default/App.jsonl.template +5 -0
  125. package/src/templates/datasets/postgres-default/Company.jsonl.template +4 -0
  126. package/src/templates/datasets/postgres-default/Person.jsonl.template +3 -0
  127. package/src/templates/docs/app-description.md.template +34 -0
  128. package/src/templates/gql/codegen.yml.template +25 -0
  129. package/src/templates/gql/index.ts.template +24 -0
  130. package/src/templates/gql/operations.graphql.template +30 -0
  131. package/src/templates/package.json.template +38 -0
  132. package/src/templates/prompt-analysis.md.template +111 -0
  133. package/src/templates/prompt-script-generation.md.template +259 -0
  134. package/src/templates/src/Address.ts.template +31 -0
  135. package/src/templates/src/App.ts.template +61 -0
  136. package/src/templates/src/Company.ts.template +48 -0
  137. package/src/templates/src/Models.test.ts.template +655 -0
  138. package/src/templates/src/Person.test.ts.template +289 -0
  139. package/src/templates/src/Person.ts.template +105 -0
  140. package/src/templates/src/actions/index.ts.template +12 -0
  141. package/src/templates/src/index.ts +66 -0
  142. package/src/templates/src/types/gql.d.ts.template +18 -0
  143. package/src/templates/vscode/extensions.json +3 -0
  144. package/src/templates/vscode/settings.json +11 -0
@@ -0,0 +1,435 @@
1
+ {
2
+ "commands": {
3
+ "cli-build": {
4
+ "aliases": [
5
+ "cli-build"
6
+ ],
7
+ "args": {},
8
+ "description": "Rebuild the Slingr CLI tool itself. This command is used for CLI development and maintenance, not for building Slingr applications.",
9
+ "examples": [
10
+ "<%= config.bin %> <%= command.id %>",
11
+ "Description: Use this command when you need to rebuild the Slingr CLI after making changes to the CLI codebase."
12
+ ],
13
+ "flags": {},
14
+ "hasDynamicHelp": false,
15
+ "hiddenAliases": [],
16
+ "id": "cli-build",
17
+ "pluginAlias": "@slingr/cli",
18
+ "pluginName": "@slingr/cli",
19
+ "pluginType": "core",
20
+ "strict": false,
21
+ "enableJsonFlag": false,
22
+ "isESM": false,
23
+ "relativePath": [
24
+ "dist",
25
+ "commands",
26
+ "cli-build.js"
27
+ ]
28
+ },
29
+ "create-app": {
30
+ "aliases": [],
31
+ "args": {
32
+ "name": {
33
+ "description": "Name of the app to create",
34
+ "name": "name",
35
+ "required": false
36
+ }
37
+ },
38
+ "description": "Create a new Slingr app",
39
+ "examples": [
40
+ "<%= config.bin %> <%= command.id %>",
41
+ "<%= config.bin %> <%= command.id %> my-app",
42
+ "<%= config.bin %> <%= command.id %> task-manager",
43
+ "<%= config.bin %> <%= command.id %> my-crm --type=\"CRM\" --database=postgres --description=\"A CRM system for managing customers\"",
44
+ "<%= config.bin %> <%= command.id %> my-crm --type=\"CRM\" --database=postgres --description=\"A CRM system for managing customers\" -T"
45
+ ],
46
+ "flags": {
47
+ "backend": {
48
+ "char": "b",
49
+ "description": "Include backend for the app (default: true)",
50
+ "hidden": true,
51
+ "name": "backend",
52
+ "allowNo": true,
53
+ "type": "boolean"
54
+ },
55
+ "database": {
56
+ "char": "d",
57
+ "description": "Database to use (postgres or mysql)",
58
+ "name": "database",
59
+ "hasDynamicHelp": false,
60
+ "multiple": false,
61
+ "options": [
62
+ "postgres",
63
+ "mysql"
64
+ ],
65
+ "type": "option"
66
+ },
67
+ "description": {
68
+ "char": "D",
69
+ "description": "Description of what the app needs to do",
70
+ "name": "description",
71
+ "hasDynamicHelp": false,
72
+ "multiple": false,
73
+ "type": "option"
74
+ },
75
+ "frontend": {
76
+ "char": "f",
77
+ "description": "Include frontend for the app (default: true)",
78
+ "hidden": true,
79
+ "name": "frontend",
80
+ "allowNo": true,
81
+ "type": "boolean"
82
+ },
83
+ "help": {
84
+ "char": "h",
85
+ "description": "Show CLI help.",
86
+ "name": "help",
87
+ "allowNo": false,
88
+ "type": "boolean"
89
+ },
90
+ "skip-setup": {
91
+ "description": "Skip the final setup prompt for non-interactive usage",
92
+ "name": "skip-setup",
93
+ "allowNo": false,
94
+ "type": "boolean"
95
+ },
96
+ "templates": {
97
+ "char": "T",
98
+ "description": "Include template models and tests in the project",
99
+ "name": "templates",
100
+ "allowNo": false,
101
+ "type": "boolean"
102
+ },
103
+ "type": {
104
+ "char": "t",
105
+ "description": "Type of app (e.g., CRM, task manager, ERP)",
106
+ "name": "type",
107
+ "hasDynamicHelp": false,
108
+ "multiple": false,
109
+ "type": "option"
110
+ }
111
+ },
112
+ "hasDynamicHelp": false,
113
+ "hiddenAliases": [],
114
+ "id": "create-app",
115
+ "pluginAlias": "@slingr/cli",
116
+ "pluginName": "@slingr/cli",
117
+ "pluginType": "core",
118
+ "strict": true,
119
+ "enableJsonFlag": false,
120
+ "isESM": false,
121
+ "relativePath": [
122
+ "dist",
123
+ "commands",
124
+ "create-app.js"
125
+ ]
126
+ },
127
+ "ds": {
128
+ "aliases": [],
129
+ "args": {
130
+ "datasource": {
131
+ "description": "Name of the datasource to manage",
132
+ "name": "datasource",
133
+ "required": true
134
+ },
135
+ "action": {
136
+ "description": "Action to perform (load or reset)",
137
+ "name": "action",
138
+ "options": [
139
+ "load",
140
+ "reset"
141
+ ],
142
+ "required": true
143
+ },
144
+ "dataset": {
145
+ "default": "default",
146
+ "description": "Name of the dataset to load (defaults to \"default\")",
147
+ "name": "dataset",
148
+ "required": false
149
+ }
150
+ },
151
+ "description": "Manage datasets for datasources",
152
+ "examples": [
153
+ "slingr ds postgres load",
154
+ "slingr ds postgres load custom-dataset",
155
+ "slingr ds mysql load default",
156
+ "slingr ds postgres reset"
157
+ ],
158
+ "flags": {},
159
+ "hasDynamicHelp": false,
160
+ "hiddenAliases": [],
161
+ "id": "ds",
162
+ "pluginAlias": "@slingr/cli",
163
+ "pluginName": "@slingr/cli",
164
+ "pluginType": "core",
165
+ "strict": true,
166
+ "enableJsonFlag": false,
167
+ "isESM": false,
168
+ "relativePath": [
169
+ "dist",
170
+ "commands",
171
+ "ds.js"
172
+ ]
173
+ },
174
+ "gql": {
175
+ "aliases": [],
176
+ "args": {
177
+ "action": {
178
+ "description": "Action to perform (generate-schema or generate-sdk)",
179
+ "name": "action",
180
+ "options": [
181
+ "generate-schema",
182
+ "generate-sdk"
183
+ ],
184
+ "required": true
185
+ }
186
+ },
187
+ "description": "Generate GraphQL schema and SDK for your Slingr application",
188
+ "examples": [
189
+ "slingr gql generate-schema",
190
+ "slingr gql generate-schema --no-exit",
191
+ "slingr gql generate-sdk"
192
+ ],
193
+ "flags": {
194
+ "no-exit": {
195
+ "description": "Keep Apollo Server running after generating schema (for generate-schema only)",
196
+ "name": "no-exit",
197
+ "allowNo": false,
198
+ "type": "boolean"
199
+ }
200
+ },
201
+ "hasDynamicHelp": false,
202
+ "hiddenAliases": [],
203
+ "id": "gql",
204
+ "pluginAlias": "@slingr/cli",
205
+ "pluginName": "@slingr/cli",
206
+ "pluginType": "core",
207
+ "strict": true,
208
+ "enableJsonFlag": false,
209
+ "isESM": false,
210
+ "relativePath": [
211
+ "dist",
212
+ "commands",
213
+ "gql.js"
214
+ ]
215
+ },
216
+ "run": {
217
+ "aliases": [],
218
+ "args": {},
219
+ "description": "Run a Slingr application locally",
220
+ "examples": [
221
+ "<%= config.bin %> <%= command.id %>",
222
+ "<%= config.bin %> <%= command.id %> --skip-infra"
223
+ ],
224
+ "flags": {
225
+ "help": {
226
+ "char": "h",
227
+ "description": "Show CLI help.",
228
+ "name": "help",
229
+ "allowNo": false,
230
+ "type": "boolean"
231
+ },
232
+ "skip-infra": {
233
+ "char": "i",
234
+ "description": "Skip infrastructure setup and checks",
235
+ "name": "skip-infra",
236
+ "required": false,
237
+ "allowNo": false,
238
+ "type": "boolean"
239
+ }
240
+ },
241
+ "hasDynamicHelp": false,
242
+ "hiddenAliases": [],
243
+ "id": "run",
244
+ "pluginAlias": "@slingr/cli",
245
+ "pluginName": "@slingr/cli",
246
+ "pluginType": "core",
247
+ "strict": true,
248
+ "enableJsonFlag": false,
249
+ "isESM": false,
250
+ "relativePath": [
251
+ "dist",
252
+ "commands",
253
+ "run.js"
254
+ ]
255
+ },
256
+ "setup": {
257
+ "aliases": [],
258
+ "args": {},
259
+ "description": "Complete setup of a Slingr application with framework, schema, and SDK generation",
260
+ "examples": [
261
+ "slingr setup",
262
+ "slingr setup --skip-install",
263
+ "slingr setup --skip-schema"
264
+ ],
265
+ "flags": {
266
+ "skip-install": {
267
+ "description": "Skip npm install step",
268
+ "name": "skip-install",
269
+ "allowNo": false,
270
+ "type": "boolean"
271
+ },
272
+ "skip-schema": {
273
+ "description": "Skip schema generation step",
274
+ "name": "skip-schema",
275
+ "allowNo": false,
276
+ "type": "boolean"
277
+ },
278
+ "skip-sdk": {
279
+ "description": "Skip SDK generation step",
280
+ "name": "skip-sdk",
281
+ "allowNo": false,
282
+ "type": "boolean"
283
+ },
284
+ "help": {
285
+ "char": "h",
286
+ "description": "Show CLI help.",
287
+ "name": "help",
288
+ "allowNo": false,
289
+ "type": "boolean"
290
+ }
291
+ },
292
+ "hasDynamicHelp": false,
293
+ "hiddenAliases": [],
294
+ "id": "setup",
295
+ "pluginAlias": "@slingr/cli",
296
+ "pluginName": "@slingr/cli",
297
+ "pluginType": "core",
298
+ "strict": true,
299
+ "enableJsonFlag": false,
300
+ "isESM": false,
301
+ "relativePath": [
302
+ "dist",
303
+ "commands",
304
+ "setup.js"
305
+ ]
306
+ },
307
+ "infra:down": {
308
+ "aliases": [],
309
+ "args": {},
310
+ "description": "Stop infrastructure services using Docker Compose (data is preserved by default)",
311
+ "examples": [
312
+ "<%= config.bin %> <%= command.id %> # Stop services, preserve data",
313
+ "<%= config.bin %> <%= command.id %> --volumes # Stop services and delete all data"
314
+ ],
315
+ "flags": {
316
+ "help": {
317
+ "char": "h",
318
+ "description": "Show CLI help.",
319
+ "name": "help",
320
+ "allowNo": false,
321
+ "type": "boolean"
322
+ },
323
+ "volumes": {
324
+ "char": "v",
325
+ "description": "Remove volumes as well (WARNING: This will delete all data)",
326
+ "name": "volumes",
327
+ "allowNo": false,
328
+ "type": "boolean"
329
+ }
330
+ },
331
+ "hasDynamicHelp": false,
332
+ "hiddenAliases": [],
333
+ "id": "infra:down",
334
+ "pluginAlias": "@slingr/cli",
335
+ "pluginName": "@slingr/cli",
336
+ "pluginType": "core",
337
+ "strict": true,
338
+ "enableJsonFlag": false,
339
+ "isESM": false,
340
+ "relativePath": [
341
+ "dist",
342
+ "commands",
343
+ "infra",
344
+ "down.js"
345
+ ]
346
+ },
347
+ "infra:up": {
348
+ "aliases": [],
349
+ "args": {},
350
+ "description": "Start infrastructure services using Docker Compose",
351
+ "examples": [
352
+ "<%= config.bin %> <%= command.id %>",
353
+ "<%= config.bin %> <%= command.id %> --detach"
354
+ ],
355
+ "flags": {
356
+ "detach": {
357
+ "char": "d",
358
+ "description": "Run services in detached mode (background)",
359
+ "name": "detach",
360
+ "allowNo": false,
361
+ "type": "boolean"
362
+ },
363
+ "help": {
364
+ "char": "h",
365
+ "description": "Show CLI help.",
366
+ "name": "help",
367
+ "allowNo": false,
368
+ "type": "boolean"
369
+ }
370
+ },
371
+ "hasDynamicHelp": false,
372
+ "hiddenAliases": [],
373
+ "id": "infra:up",
374
+ "pluginAlias": "@slingr/cli",
375
+ "pluginName": "@slingr/cli",
376
+ "pluginType": "core",
377
+ "strict": true,
378
+ "enableJsonFlag": false,
379
+ "isESM": false,
380
+ "relativePath": [
381
+ "dist",
382
+ "commands",
383
+ "infra",
384
+ "up.js"
385
+ ]
386
+ },
387
+ "infra:update": {
388
+ "aliases": [],
389
+ "args": {},
390
+ "description": "Update infrastructure configuration based on metadata",
391
+ "examples": [
392
+ "<%= config.bin %> <%= command.id %>",
393
+ "<%= config.bin %> <%= command.id %> --file postgres.ts",
394
+ "<%= config.bin %> <%= command.id %> -f mysql.ts",
395
+ "<%= config.bin %> <%= command.id %> --all",
396
+ "<%= config.bin %> <%= command.id %> -a"
397
+ ],
398
+ "flags": {
399
+ "all": {
400
+ "char": "a",
401
+ "description": "Update all available data sources",
402
+ "name": "all",
403
+ "required": false,
404
+ "allowNo": false,
405
+ "type": "boolean"
406
+ },
407
+ "file": {
408
+ "char": "f",
409
+ "description": "Optional: Specific data source file to update",
410
+ "name": "file",
411
+ "required": false,
412
+ "hasDynamicHelp": false,
413
+ "multiple": false,
414
+ "type": "option"
415
+ }
416
+ },
417
+ "hasDynamicHelp": false,
418
+ "hiddenAliases": [],
419
+ "id": "infra:update",
420
+ "pluginAlias": "@slingr/cli",
421
+ "pluginName": "@slingr/cli",
422
+ "pluginType": "core",
423
+ "strict": true,
424
+ "enableJsonFlag": false,
425
+ "isESM": false,
426
+ "relativePath": [
427
+ "dist",
428
+ "commands",
429
+ "infra",
430
+ "update.js"
431
+ ]
432
+ }
433
+ },
434
+ "version": "0.0.1"
435
+ }
package/package.json ADDED
@@ -0,0 +1,118 @@
1
+ {
2
+ "name": "@slingr/cli",
3
+ "description": "Slingr CLI tool for creating and managing Slingr applications",
4
+ "version": "0.0.1",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "bin": {
9
+ "slingr": "./bin/run.js"
10
+ },
11
+ "dependencies": {
12
+ "@faker-js/faker": "^8.4.1",
13
+ "@oclif/core": "^4",
14
+ "@oclif/plugin-help": "^6",
15
+ "@types/fs-extra": "^11.0.4",
16
+ "@types/inquirer": "^8.2.12",
17
+ "@types/js-yaml": "^4.0.9",
18
+ "fs-extra": "^11.3.1",
19
+ "glob": "^11.0.0",
20
+ "graphql": "^16.11.0",
21
+ "inquirer": "^8.2.7",
22
+ "js-yaml": "^4.1.0",
23
+ "mocha": "^11.7.4",
24
+ "reflect-metadata": "^0.2.2",
25
+ "slingr-framework": "file:../framework"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/compat": "^1",
29
+ "@oclif/prettier-config": "^0.2.1",
30
+ "@oclif/test": "^4",
31
+ "@types/chai": "^4",
32
+ "@types/mocha": "^10.0.6",
33
+ "@types/node": "^18",
34
+ "chai": "^4",
35
+ "eslint": "^9",
36
+ "eslint-config-oclif": "^6",
37
+ "eslint-config-prettier": "^10",
38
+ "nyc": "^17.1.0",
39
+ "oclif": "^4",
40
+ "shx": "^0.3.3",
41
+ "ts-node": "^10.9.2",
42
+ "typescript": "^5"
43
+ },
44
+ "overrides": {
45
+ "glob": "^11.0.0",
46
+ "inflight": "npm:@lukekarrys/inflight@^1.0.6",
47
+ "nyc": {
48
+ "rimraf": "^5.0.0"
49
+ }
50
+ },
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ },
54
+ "files": [
55
+ "./bin",
56
+ "./dist",
57
+ "./src/templates",
58
+ "./oclif.manifest.json"
59
+ ],
60
+ "author": "Slingr",
61
+ "license": "Apache-2.0",
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "https://github.com/slingr-stack/framework.git"
65
+ },
66
+ "homepage": "https://github.com/slingr-stack/framework",
67
+ "readme": "https://github.com/slingr-stack/framework#readme",
68
+ "bugs": {
69
+ "url": "https://github.com/slingr-stack/framework/issues"
70
+ },
71
+ "keywords": [
72
+ "slingr",
73
+ "cli",
74
+ "scaffolding",
75
+ "project-generator"
76
+ ],
77
+ "main": "dist/index.js",
78
+ "oclif": {
79
+ "bin": "slingr",
80
+ "dirname": "slingr",
81
+ "commands": "./dist/commands",
82
+ "plugins": [
83
+ "@oclif/plugin-help"
84
+ ],
85
+ "topicSeparator": " "
86
+ },
87
+ "scripts": {
88
+ "build": "shx rm -rf dist && tsc -b && shx cp -r src/templates dist/ && shx cp -r src/scripts dist/",
89
+ "lint": "eslint",
90
+ "postpack": "shx rm -f oclif.manifest.json",
91
+ "prepack": "oclif manifest && oclif readme",
92
+ "setup": "npm run build && npm run prepack && npm link",
93
+ "test": "mocha -r ts-node/register --timeout 60000 --forbid-only \"test/**/*.test.ts\"",
94
+ "coverage": "nyc --reporter=text --reporter=text-summary --reporter=json-summary mocha --forbid-only \"test/**/*.test.ts\"",
95
+ "version": "oclif readme && git add README.md"
96
+ },
97
+ "types": "dist/index.d.ts",
98
+ "nyc": {
99
+ "include": [
100
+ "src/**/*.ts"
101
+ ],
102
+ "extension": [
103
+ ".ts"
104
+ ],
105
+ "require": [
106
+ "ts-node/register/transpile-only"
107
+ ],
108
+ "reporter": [
109
+ "text",
110
+ "text-summary",
111
+ "json-summary"
112
+ ],
113
+ "sourceMap": true,
114
+ "instrument": true,
115
+ "all": true,
116
+ "cache": false
117
+ }
118
+ }
@@ -0,0 +1,17 @@
1
+ # GitHub Copilot Instructions for {{APP_NAME}}
2
+
3
+ This is a {{APP_TYPE}} application built with Slingr.
4
+
5
+ ## Project Description
6
+ {{DESCRIPTION}}
7
+
8
+ ## Architecture
9
+ - Backend: {{HAS_BACKEND}}
10
+ - Frontend: {{HAS_FRONTEND}}
11
+ - Database: {{DB_TYPE}}
12
+
13
+ ## Development Guidelines
14
+ - Use TypeScript for all code
15
+ - Follow Slingr conventions and patterns
16
+ - Maintain clean, readable code with proper documentation
17
+ - Use the provided data models as starting points
@@ -0,0 +1,9 @@
1
+ import { TypeOrmSqlDataSource } from 'slingr-framework'
2
+
3
+ export const mainDataSource = new TypeOrmSqlDataSource({
4
+ type: '{{DB_TYPE}}',
5
+ managed: true,
6
+ filename: ':memory:',
7
+ logging: false,
8
+ synchronize: true,
9
+ })
@@ -0,0 +1,30 @@
1
+ import type { Config } from 'jest';
2
+
3
+ const config: Config = {
4
+ coverageProvider: 'v8',
5
+ moduleDirectories: ['node_modules', '<rootDir>'],
6
+ moduleNameMapper: {
7
+ '#(.*)': '<rootDir>/node_modules/$1',
8
+ 'slingr-framework': '<rootDir>/node_modules/slingr-framework',
9
+ },
10
+ modulePaths: ['<rootDir>'],
11
+ preset: 'ts-jest',
12
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
13
+ testEnvironment: 'node',
14
+ testMatch: ['<rootDir>/src/**/*.test.ts'],
15
+ transform: {
16
+ '^.+\\.(ts|tsx|js|jsx)$': [
17
+ 'ts-jest',
18
+ {
19
+ tsconfig: {
20
+ module: 'commonjs',
21
+ allowJs: true,
22
+ },
23
+ },
24
+ ],
25
+ '^.+\\.[j]sx?$': 'babel-jest',
26
+ },
27
+ transformIgnorePatterns: ['/node_modules/(?!slingr-framework)'],
28
+ };
29
+
30
+ module.exports = config;
@@ -0,0 +1 @@
1
+ import 'reflect-metadata';
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "moduleResolution": "nodenext",
5
+ "target": "es2020",
6
+ "types": ["node", "jest"],
7
+ "sourceMap": true,
8
+ "declaration": true,
9
+ "declarationMap": true,
10
+ "noUncheckedIndexedAccess": false,
11
+ "exactOptionalPropertyTypes": false,
12
+ "strict": true,
13
+ "jsx": "react-jsx",
14
+ "verbatimModuleSyntax": false,
15
+ "isolatedModules": true,
16
+ "noUncheckedSideEffectImports": true,
17
+ "moduleDetection": "force",
18
+ "skipLibCheck": true,
19
+ "experimentalDecorators": true,
20
+ "emitDecoratorMetadata": true,
21
+ "esModuleInterop": true,
22
+ "outDir": "./dist",
23
+ "paths": {
24
+ "@gql": ["./generated/gql/index.ts"],
25
+ "@gql/*": ["./generated/gql/*"]
26
+ }
27
+ },
28
+ "include": ["src/**/*", "test/**/*", "jest.config.js", "index.ts"],
29
+ "exclude": ["node_modules", "dist"]
30
+ }
@@ -0,0 +1,13 @@
1
+ import { TypeOrmSqlDataSource } from 'slingr-framework';
2
+
3
+ export const mainDs = new TypeOrmSqlDataSource({
4
+ type: 'mysql',
5
+ host: 'localhost',
6
+ port: 3306,
7
+ username: 'root',
8
+ password: 'root',
9
+ database: '{{APP_NAME}}',
10
+ synchronize: true,
11
+ logging: true,
12
+ managed: true
13
+ });
@@ -0,0 +1,13 @@
1
+ import { TypeOrmSqlDataSource } from 'slingr-framework';
2
+
3
+ export const mainDs = new TypeOrmSqlDataSource({
4
+ type: 'postgres',
5
+ host: 'localhost',
6
+ port: 5433,
7
+ username: 'postgres',
8
+ password: 'postgres',
9
+ database: '{{APP_NAME}}',
10
+ synchronize: true,
11
+ logging: true,
12
+ managed: true
13
+ });