@slingr/cli 0.0.3 → 0.0.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.
Files changed (251) hide show
  1. package/LICENSE.txt +202 -0
  2. package/README.md +490 -319
  3. package/bin/dev.cmd +2 -2
  4. package/bin/dev.js +5 -5
  5. package/bin/run.cmd +2 -2
  6. package/bin/run.js +4 -4
  7. package/bin/slingr +1 -0
  8. package/dist/commands/build.d.ts +20 -0
  9. package/dist/commands/build.d.ts.map +1 -0
  10. package/dist/commands/build.js +206 -0
  11. package/dist/commands/build.js.map +1 -0
  12. package/dist/commands/create-app.d.ts +0 -1
  13. package/dist/commands/create-app.d.ts.map +1 -1
  14. package/dist/commands/create-app.js +38 -57
  15. package/dist/commands/create-app.js.map +1 -1
  16. package/dist/commands/debug.d.ts +28 -0
  17. package/dist/commands/debug.d.ts.map +1 -0
  18. package/dist/commands/debug.js +474 -0
  19. package/dist/commands/debug.js.map +1 -0
  20. package/dist/commands/ds.d.ts +14 -1
  21. package/dist/commands/ds.d.ts.map +1 -1
  22. package/dist/commands/ds.js +450 -121
  23. package/dist/commands/ds.js.map +1 -1
  24. package/dist/commands/gql.d.ts +1 -1
  25. package/dist/commands/gql.d.ts.map +1 -1
  26. package/dist/commands/gql.js +190 -184
  27. package/dist/commands/gql.js.map +1 -1
  28. package/dist/commands/infra/down.d.ts.map +1 -1
  29. package/dist/commands/infra/down.js +8 -7
  30. package/dist/commands/infra/down.js.map +1 -1
  31. package/dist/commands/infra/up.d.ts.map +1 -1
  32. package/dist/commands/infra/up.js +8 -7
  33. package/dist/commands/infra/up.js.map +1 -1
  34. package/dist/commands/infra/update.d.ts +1 -0
  35. package/dist/commands/infra/update.d.ts.map +1 -1
  36. package/dist/commands/infra/update.js +33 -69
  37. package/dist/commands/infra/update.js.map +1 -1
  38. package/dist/commands/run.d.ts +29 -2
  39. package/dist/commands/run.d.ts.map +1 -1
  40. package/dist/commands/run.js +628 -130
  41. package/dist/commands/run.js.map +1 -1
  42. package/dist/commands/setup.d.ts +1 -1
  43. package/dist/commands/setup.d.ts.map +1 -1
  44. package/dist/commands/setup.js +34 -71
  45. package/dist/commands/setup.js.map +1 -1
  46. package/dist/commands/sync-metadata.d.ts +15 -0
  47. package/dist/commands/sync-metadata.d.ts.map +1 -0
  48. package/dist/commands/sync-metadata.js +225 -0
  49. package/dist/commands/sync-metadata.js.map +1 -0
  50. package/dist/commands/users.d.ts +30 -0
  51. package/dist/commands/users.d.ts.map +1 -0
  52. package/dist/commands/users.js +472 -0
  53. package/dist/commands/users.js.map +1 -0
  54. package/dist/commands/views.d.ts +11 -0
  55. package/dist/commands/views.d.ts.map +1 -0
  56. package/dist/commands/views.js +73 -0
  57. package/dist/commands/views.js.map +1 -0
  58. package/dist/projectStructure.d.ts +2 -2
  59. package/dist/projectStructure.d.ts.map +1 -1
  60. package/dist/projectStructure.js +281 -69
  61. package/dist/projectStructure.js.map +1 -1
  62. package/dist/scripts/generate-metadata.d.ts +13 -0
  63. package/dist/scripts/generate-metadata.d.ts.map +1 -0
  64. package/dist/scripts/generate-metadata.js +412 -0
  65. package/dist/scripts/generate-metadata.js.map +1 -0
  66. package/dist/scripts/generate-metadata.ts +498 -0
  67. package/dist/scripts/generate-schema.d.ts +1 -1
  68. package/dist/scripts/generate-schema.js +168 -74
  69. package/dist/scripts/generate-schema.js.map +1 -1
  70. package/dist/scripts/generate-schema.ts +258 -143
  71. package/dist/templates/.env.template +23 -0
  72. package/dist/templates/.firebaserc.template +5 -0
  73. package/dist/templates/.github/copilot-instructions.md.template +652 -17
  74. package/dist/templates/backend/Dockerfile.template +30 -0
  75. package/dist/templates/config/datasource.ts.template +12 -9
  76. package/dist/templates/config/jest.config.ts +30 -30
  77. package/dist/templates/config/jest.setup.ts +1 -1
  78. package/dist/templates/config/tsconfig.json.template +50 -29
  79. package/dist/templates/dataSources/mysql.ts.template +16 -13
  80. package/dist/templates/dataSources/postgres.ts.template +15 -13
  81. package/dist/templates/dataset-generator-script.ts.template +139 -139
  82. package/dist/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
  83. package/dist/templates/datasets/mysql-default/Address.jsonl.template +3 -3
  84. package/dist/templates/datasets/mysql-default/App.jsonl.template +4 -4
  85. package/dist/templates/datasets/mysql-default/Company.jsonl.template +3 -3
  86. package/dist/templates/datasets/mysql-default/Person.jsonl.template +2 -2
  87. package/dist/templates/datasets/mysql-default/User.jsonl.template +1 -0
  88. package/dist/templates/datasets/mysql-default/instructions.md.template +1 -0
  89. package/dist/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
  90. package/dist/templates/datasets/postgres-default/Address.jsonl.template +3 -3
  91. package/dist/templates/datasets/postgres-default/App.jsonl.template +4 -4
  92. package/dist/templates/datasets/postgres-default/Company.jsonl.template +3 -3
  93. package/dist/templates/datasets/postgres-default/Person.jsonl.template +2 -2
  94. package/dist/templates/datasets/postgres-default/User.jsonl.template +1 -0
  95. package/dist/templates/datasets/postgres-default/instructions.md.template +1 -0
  96. package/dist/templates/docker-compose.prod-test.yml.template +32 -0
  97. package/dist/templates/docker-compose.yml.template +24 -0
  98. package/dist/templates/docs/app-description.md.template +33 -33
  99. package/dist/templates/firebase.json.template +68 -0
  100. package/dist/templates/frontend/.umirc.ts.template +23 -0
  101. package/dist/templates/frontend/package.json.template +45 -0
  102. package/dist/templates/frontend/public/config.json +6 -0
  103. package/dist/templates/frontend/public/logo.svg +6 -0
  104. package/dist/templates/frontend/src/app.tsx.template +44 -0
  105. package/dist/templates/frontend/src/global.less.template +117 -0
  106. package/dist/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
  107. package/dist/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
  108. package/dist/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
  109. package/dist/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
  110. package/dist/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
  111. package/dist/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
  112. package/dist/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
  113. package/dist/templates/frontend/tsconfig.json.template +50 -0
  114. package/dist/templates/gql/codegen.yml.template +25 -25
  115. package/dist/templates/gql/index.ts.template +17 -24
  116. package/dist/templates/gql/operations.graphql.template +30 -30
  117. package/dist/templates/ops/README.md.template +1045 -0
  118. package/dist/templates/ops/cloudbuild.yaml.template +161 -0
  119. package/dist/templates/ops/scripts/_utils.js.template +217 -0
  120. package/dist/templates/ops/scripts/deploy.js.template +145 -0
  121. package/dist/templates/ops/scripts/setup-gcp.js.template +330 -0
  122. package/dist/templates/ops/scripts/setup-secrets.js.template +76 -0
  123. package/dist/templates/ops/scripts/test-prod-local.js.template +49 -0
  124. package/dist/templates/package.json.template +50 -38
  125. package/dist/templates/pnpm-workspace.yaml.template +3 -0
  126. package/dist/templates/prompt-analysis.md.template +110 -110
  127. package/dist/templates/prompt-script-generation.md.template +258 -258
  128. package/dist/templates/src/Address.ts.template +28 -31
  129. package/dist/templates/src/App.ts.template +17 -61
  130. package/dist/templates/src/Company.ts.template +41 -47
  131. package/dist/templates/src/Models.test.ts.template +654 -654
  132. package/dist/templates/src/Person.test.ts.template +289 -289
  133. package/dist/templates/src/Person.ts.template +90 -105
  134. package/dist/templates/src/actions/index.ts.template +11 -11
  135. package/dist/templates/src/auth/permissions.ts.template +34 -0
  136. package/dist/templates/src/data/App.ts.template +48 -0
  137. package/dist/templates/src/data/User.ts.template +35 -0
  138. package/dist/templates/src/types/gql.d.ts.template +17 -17
  139. package/dist/templates/vscode/extensions.json +4 -3
  140. package/dist/templates/vscode/settings.json +17 -11
  141. package/dist/templates/workspace-package.json.template +21 -0
  142. package/dist/utils/buildCache.d.ts +12 -0
  143. package/dist/utils/buildCache.d.ts.map +1 -0
  144. package/dist/utils/buildCache.js +102 -0
  145. package/dist/utils/buildCache.js.map +1 -0
  146. package/dist/utils/checkFramework.d.ts +27 -0
  147. package/dist/utils/checkFramework.d.ts.map +1 -0
  148. package/dist/utils/checkFramework.js +104 -0
  149. package/dist/utils/checkFramework.js.map +1 -0
  150. package/dist/utils/datasourceParser.d.ts +11 -0
  151. package/dist/utils/datasourceParser.d.ts.map +1 -1
  152. package/dist/utils/datasourceParser.js +154 -56
  153. package/dist/utils/datasourceParser.js.map +1 -1
  154. package/dist/utils/dockerManager.d.ts +25 -0
  155. package/dist/utils/dockerManager.d.ts.map +1 -0
  156. package/dist/utils/dockerManager.js +281 -0
  157. package/dist/utils/dockerManager.js.map +1 -0
  158. package/dist/utils/infraFileParser.d.ts +26 -0
  159. package/dist/utils/infraFileParser.d.ts.map +1 -0
  160. package/dist/utils/infraFileParser.js +75 -0
  161. package/dist/utils/infraFileParser.js.map +1 -0
  162. package/dist/utils/jsonlLoader.d.ts +91 -12
  163. package/dist/utils/jsonlLoader.d.ts.map +1 -1
  164. package/dist/utils/jsonlLoader.js +674 -63
  165. package/dist/utils/jsonlLoader.js.map +1 -1
  166. package/dist/utils/model-analyzer.d.ts.map +1 -1
  167. package/dist/utils/model-analyzer.js +67 -13
  168. package/dist/utils/model-analyzer.js.map +1 -1
  169. package/dist/utils/userManagement.d.ts +57 -0
  170. package/dist/utils/userManagement.d.ts.map +1 -0
  171. package/dist/utils/userManagement.js +288 -0
  172. package/dist/utils/userManagement.js.map +1 -0
  173. package/dist/utils/viewsGenerator.d.ts +15 -0
  174. package/dist/utils/viewsGenerator.d.ts.map +1 -0
  175. package/dist/utils/viewsGenerator.js +311 -0
  176. package/dist/utils/viewsGenerator.js.map +1 -0
  177. package/oclif.manifest.json +445 -20
  178. package/package.json +29 -26
  179. package/src/templates/.env.template +23 -0
  180. package/src/templates/.firebaserc.template +5 -0
  181. package/src/templates/.github/copilot-instructions.md.template +652 -17
  182. package/src/templates/backend/Dockerfile.template +30 -0
  183. package/src/templates/config/datasource.ts.template +12 -9
  184. package/src/templates/config/jest.config.ts +30 -30
  185. package/src/templates/config/jest.setup.ts +1 -1
  186. package/src/templates/config/tsconfig.json.template +50 -29
  187. package/src/templates/dataSources/mysql.ts.template +16 -13
  188. package/src/templates/dataSources/postgres.ts.template +15 -13
  189. package/src/templates/dataset-generator-script.ts.template +139 -139
  190. package/src/templates/datasets/mysql-default/.slingr-schema.json.template +5 -0
  191. package/src/templates/datasets/mysql-default/Address.jsonl.template +3 -3
  192. package/src/templates/datasets/mysql-default/App.jsonl.template +4 -4
  193. package/src/templates/datasets/mysql-default/Company.jsonl.template +3 -3
  194. package/src/templates/datasets/mysql-default/Person.jsonl.template +2 -2
  195. package/src/templates/datasets/mysql-default/User.jsonl.template +1 -0
  196. package/src/templates/datasets/mysql-default/instructions.md.template +1 -0
  197. package/src/templates/datasets/postgres-default/.slingr-schema.json.template +5 -0
  198. package/src/templates/datasets/postgres-default/Address.jsonl.template +3 -3
  199. package/src/templates/datasets/postgres-default/App.jsonl.template +4 -4
  200. package/src/templates/datasets/postgres-default/Company.jsonl.template +3 -3
  201. package/src/templates/datasets/postgres-default/Person.jsonl.template +2 -2
  202. package/src/templates/datasets/postgres-default/User.jsonl.template +1 -0
  203. package/src/templates/datasets/postgres-default/instructions.md.template +1 -0
  204. package/src/templates/docker-compose.prod-test.yml.template +32 -0
  205. package/src/templates/docker-compose.yml.template +24 -0
  206. package/src/templates/docs/app-description.md.template +33 -33
  207. package/src/templates/firebase.json.template +68 -0
  208. package/src/templates/frontend/.umirc.ts.template +23 -0
  209. package/src/templates/frontend/package.json.template +45 -0
  210. package/src/templates/frontend/public/config.json +6 -0
  211. package/src/templates/frontend/public/logo.svg +6 -0
  212. package/src/templates/frontend/src/app.tsx.template +44 -0
  213. package/src/templates/frontend/src/global.less.template +117 -0
  214. package/src/templates/frontend/src/layouts/MainLayout.tsx.template +75 -0
  215. package/src/templates/frontend/src/types/graphql-augmentation.d.ts.template +44 -0
  216. package/src/templates/frontend/src/views/customViews/user/UserCreateView.tsx.template +18 -0
  217. package/src/templates/frontend/src/views/customViews/user/UserEditView.tsx.template +29 -0
  218. package/src/templates/frontend/src/views/customViews/user/UserReadView.tsx.template +24 -0
  219. package/src/templates/frontend/src/views/customViews/user/UserTableView.tsx.template +38 -0
  220. package/src/templates/frontend/src/views/customViews/welcome.tsx.template +34 -0
  221. package/src/templates/frontend/tsconfig.json.template +50 -0
  222. package/src/templates/gql/codegen.yml.template +25 -25
  223. package/src/templates/gql/index.ts.template +17 -24
  224. package/src/templates/gql/operations.graphql.template +30 -30
  225. package/src/templates/ops/README.md.template +1045 -0
  226. package/src/templates/ops/cloudbuild.yaml.template +161 -0
  227. package/src/templates/ops/scripts/_utils.js.template +217 -0
  228. package/src/templates/ops/scripts/deploy.js.template +145 -0
  229. package/src/templates/ops/scripts/setup-gcp.js.template +330 -0
  230. package/src/templates/ops/scripts/setup-secrets.js.template +76 -0
  231. package/src/templates/ops/scripts/test-prod-local.js.template +49 -0
  232. package/src/templates/package.json.template +50 -38
  233. package/src/templates/pnpm-workspace.yaml.template +3 -0
  234. package/src/templates/prompt-analysis.md.template +110 -110
  235. package/src/templates/prompt-script-generation.md.template +258 -258
  236. package/src/templates/src/Address.ts.template +28 -31
  237. package/src/templates/src/App.ts.template +17 -61
  238. package/src/templates/src/Company.ts.template +41 -47
  239. package/src/templates/src/Models.test.ts.template +654 -654
  240. package/src/templates/src/Person.test.ts.template +289 -289
  241. package/src/templates/src/Person.ts.template +90 -105
  242. package/src/templates/src/actions/index.ts.template +11 -11
  243. package/src/templates/src/auth/permissions.ts.template +34 -0
  244. package/src/templates/src/data/App.ts.template +48 -0
  245. package/src/templates/src/data/User.ts.template +35 -0
  246. package/src/templates/src/types/gql.d.ts.template +17 -17
  247. package/src/templates/vscode/extensions.json +4 -3
  248. package/src/templates/vscode/settings.json +17 -11
  249. package/src/templates/workspace-package.json.template +21 -0
  250. package/dist/templates/src/index.ts +0 -66
  251. package/src/templates/src/index.ts +0 -66
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  /**
4
- * Script to generate GraphQL schema from slingr-framework
4
+ * Script to generate GraphQL schema from @slingr/framework-backend
5
5
  * This script is executed in the context of a user's Slingr application
6
6
  *
7
7
  * By default, the script generates the schema and exits immediately.
@@ -13,72 +13,167 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const fs_1 = __importDefault(require("fs"));
15
15
  const path_1 = __importDefault(require("path"));
16
- const url_1 = require("url");
16
+ // Load generated view type registries if they exist so declare global augmentations are active
17
+ // during schema compilation. The file may not exist yet on the first run.
18
+ const generatedViewsPath = path_1.default.join(process.cwd(), 'generated', 'views');
19
+ if (fs_1.default.existsSync(generatedViewsPath + '.ts') || fs_1.default.existsSync(generatedViewsPath + '.js')) {
20
+ require(generatedViewsPath);
21
+ }
22
+ // @ts-ignore - temp-generate-metadata.ts is copied at runtime by the CLI
23
+ const temp_generate_metadata_1 = require("./temp-generate-metadata");
24
+ /**
25
+ * Load data sources from src/dataSources directory.
26
+ * Loads directly from TypeScript source files using ts-node.
27
+ */
28
+ async function loadDataSources() {
29
+ const dataSourcesPath = path_1.default.join(process.cwd(), 'src', 'dataSources');
30
+ if (!fs_1.default.existsSync(dataSourcesPath)) {
31
+ console.log('ā„¹ļø No dataSources directory found. Schema will be generated without CRUD operations.');
32
+ return;
33
+ }
34
+ console.log('šŸ“¦ Loading data sources from TypeScript source files...');
35
+ // Get all data source files
36
+ const files = fs_1.default.readdirSync(dataSourcesPath).filter(file => file.endsWith('.ts') && !file.endsWith('.d.ts'));
37
+ if (files.length === 0) {
38
+ console.log('ā„¹ļø No data source files found.');
39
+ return;
40
+ }
41
+ // Import each data source file using CommonJS require
42
+ for (const file of files) {
43
+ const filePath = path_1.default.join(dataSourcesPath, file);
44
+ require(filePath);
45
+ }
46
+ console.log(`āœ… Loaded ${files.length} data source(s)`);
47
+ }
48
+ /**
49
+ * Recursively collect all files matching an extension from a directory.
50
+ */
51
+ function collectFilesRecursively(dir, extension) {
52
+ const results = [];
53
+ const entries = fs_1.default.readdirSync(dir, { withFileTypes: true });
54
+ for (const entry of entries) {
55
+ const fullPath = path_1.default.join(dir, entry.name);
56
+ if (entry.isDirectory()) {
57
+ results.push(...collectFilesRecursively(fullPath, extension));
58
+ }
59
+ else if (entry.isFile() &&
60
+ entry.name.endsWith(extension) &&
61
+ !entry.name.endsWith('.d.ts') &&
62
+ !/\.test\.|\.spec\./i.test(entry.name)) {
63
+ results.push(fullPath);
64
+ }
65
+ }
66
+ return results;
67
+ }
68
+ /**
69
+ * Load model files from src/data directory (including subdirectories).
70
+ * Loads directly from TypeScript source files using tsx to avoid double decorator execution.
71
+ * @returns Array of loaded model classes
72
+ */
73
+ async function loadModels() {
74
+ const loadedModels = [];
75
+ const modelsPath = path_1.default.join(process.cwd(), 'src', 'data');
76
+ if (!fs_1.default.existsSync(modelsPath)) {
77
+ console.log('ā„¹ļø No data directory found. Schema will be generated without model CRUD operations.');
78
+ return loadedModels;
79
+ }
80
+ console.log('šŸ“¦ Loading models from TypeScript source files...');
81
+ // Recursively get all model files, excluding tests/specs and declaration files
82
+ const files = collectFilesRecursively(modelsPath, '.ts');
83
+ if (files.length === 0) {
84
+ console.log('ā„¹ļø No model files found.');
85
+ return loadedModels;
86
+ }
87
+ // Import each model file (which will trigger @DataModel decorators and register CRUD operations)
88
+ for (const filePath of files) {
89
+ const moduleExports = require(filePath);
90
+ // Extract model classes from the module exports
91
+ for (const exportName of Object.keys(moduleExports)) {
92
+ const exported = moduleExports[exportName];
93
+ if (typeof exported === 'function' && exported.prototype) {
94
+ loadedModels.push(exported);
95
+ }
96
+ }
97
+ }
98
+ console.log(`āœ… Loaded ${files.length} model(s)`);
99
+ return loadedModels;
100
+ }
17
101
  async function generateSchema() {
18
102
  try {
19
103
  console.log('šŸ”„ Generating GraphQL schema from your Slingr application...');
20
- // IMPORTANT: Import actions BEFORE importing slingr-framework
21
- // This ensures action decorators are executed before the schema is built
22
- // Try to load the compiled JavaScript version first, then fallback to TypeScript
23
- // Note: TypeScript compilation with rootDir inferred from src/ will output to dist/actions/
24
- // (without the src folder in the path)
25
- let actionsIndexPath = path_1.default.join(process.cwd(), 'dist', 'actions', 'index.js');
26
- let usingCompiledVersion = true;
104
+ // Dynamic import to avoid compile-time dependency on @slingr/framework-backend
105
+ // This script runs in the user's project context where @slingr/framework-backend is installed
106
+ // @ts-ignore
107
+ const slingrFramework = await import('@slingr/framework-backend');
108
+ const { generateActionsIndex, getGraphQLSchema, printSchema, rebuildGraphQLSchema, startGraphQLServer } = slingrFramework;
109
+ // Import framework functions first to get access to rebuildGraphQLSchema
110
+ // We must use printSchema from the same GraphQL instance as the framework
111
+ // to avoid "Cannot use GraphQLType from another module or realm" errors
112
+ // Destructure directly from the imported module (works for both ESM and CJS)
113
+ // The named exports are available directly on the module namespace object
114
+ // Rebuild the schema FIRST to clear any previous state before loading anything
115
+ // This ensures we start with a clean slate
116
+ rebuildGraphQLSchema();
117
+ // IMPORTANT: Load actions AFTER rebuilding the schema
118
+ // When actions are imported, they will register themselves in the clean schema builder
119
+ // Check if actions directory exists
120
+ const actionsDir = path_1.default.join(process.cwd(), 'src', 'actions');
27
121
  let hasActions = false;
28
- if (fs_1.default.existsSync(actionsIndexPath)) {
29
- hasActions = true;
30
- }
31
- else {
32
- // Also check the alternative path (dist/src/actions/index.js) for backwards compatibility
33
- const altActionsIndexPath = path_1.default.join(process.cwd(), 'dist', 'src', 'actions', 'index.js');
34
- if (fs_1.default.existsSync(altActionsIndexPath)) {
35
- actionsIndexPath = altActionsIndexPath;
122
+ if (fs_1.default.existsSync(actionsDir)) {
123
+ // Generate the actions index at generated/actions/index.ts
124
+ console.log('šŸ“¦ Generating actions index...');
125
+ // Generate the actions index
126
+ await generateActionsIndex(process.cwd(), 'src/actions');
127
+ // Check if the generated index exists
128
+ const generatedActionsIndexPath = path_1.default.resolve(process.cwd(), 'generated', 'actions', 'index.ts');
129
+ if (fs_1.default.existsSync(generatedActionsIndexPath)) {
36
130
  hasActions = true;
131
+ console.log('šŸ“¦ Loading actions from generated TypeScript index...');
132
+ require(generatedActionsIndexPath);
37
133
  }
38
134
  else {
39
- // Fallback to TypeScript source
40
- actionsIndexPath = path_1.default.join(process.cwd(), 'src', 'actions', 'index.ts');
41
- usingCompiledVersion = false;
42
- if (fs_1.default.existsSync(actionsIndexPath)) {
43
- hasActions = true;
44
- console.log('āš ļø TypeScript source files detected. For best compatibility, run "npm run build" to compile your application first.');
45
- }
46
- else {
47
- // Check if actions directory exists at all
48
- const actionsDir = path_1.default.join(process.cwd(), 'src', 'actions');
49
- if (fs_1.default.existsSync(actionsDir)) {
50
- console.log('āš ļø Actions directory found but no index file. Please ensure src/actions/index.ts exists or run "slingr run" to generate it automatically.');
51
- }
52
- else {
53
- console.log('ā„¹ļø No actions directory found. Schema will be generated with framework base types only.');
54
- }
55
- hasActions = false;
56
- }
57
- }
58
- }
59
- if (hasActions) {
60
- console.log(`šŸ“¦ Loading actions from ${usingCompiledVersion ? 'compiled' : 'source'} files...`);
61
- // If using TypeScript files, show a warning and try to continue
62
- if (!usingCompiledVersion) {
63
- throw new Error('TypeScript source files found but not compiled. Please run "npm run build" to compile your application first, then try again.');
135
+ console.log('āš ļø Failed to generate actions index.');
136
+ hasActions = false;
64
137
  }
65
- // Import the actions index which will register all actions via @Action decorators
66
- // Convert Windows paths to file:// URLs for ESM compatibility
67
- const actionsIndexUrl = (0, url_1.pathToFileURL)(actionsIndexPath).href;
68
- await import(actionsIndexUrl);
69
138
  }
70
139
  else {
140
+ console.log('ā„¹ļø No actions directory found. Schema will be generated with framework base types only.');
141
+ }
142
+ if (!hasActions) {
71
143
  console.log('šŸ“¦ No actions to load. Generating schema with framework base types...');
72
- } // Import framework functions and printSchema from slingr-framework
144
+ }
145
+ // Load data sources and models (which will register CRUD operations)
146
+ // Import framework functions and printSchema from slingr-framework
73
147
  // We must use printSchema from the same GraphQL instance as the framework
74
148
  // to avoid "Cannot use GraphQLType from another module or realm" errors
75
- const slingrFramework = await import('slingr-framework');
76
- const { getGraphQLSchema, rebuildGraphQLSchema, printSchema } = slingrFramework;
77
- // Force rebuild the schema to include all registered actions
78
- rebuildGraphQLSchema();
149
+ const { registerAllUiGraphQL, registerCrudOperations, generateCrudActions } = slingrFramework;
150
+ // Load data sources and models
151
+ // Actions will be generated but NOT registered in GraphQL during model import
152
+ await loadDataSources();
153
+ const loadedModels = await loadModels();
154
+ console.log('šŸ“¦ Registering UI operations for all UI-enabled models...');
155
+ await registerAllUiGraphQL();
156
+ console.log('āœ… UI operations registered');
157
+ // Register CRUD GraphQL operations for models with crud configuration
158
+ if (loadedModels.length > 0) {
159
+ for (const modelClass of loadedModels) {
160
+ const modelOptions = Reflect.getMetadata('model:options', modelClass);
161
+ const crudOptions = modelOptions?.crud;
162
+ if (crudOptions && crudOptions.api === 'gql' && crudOptions.generate) {
163
+ const dataSource = Reflect.getMetadata('model:dataSource', modelClass);
164
+ if (dataSource) {
165
+ // First generate CRUD actions (normally done by decorator)
166
+ generateCrudActions(modelClass, dataSource, crudOptions);
167
+ // Then register GraphQL operations
168
+ registerCrudOperations(modelClass);
169
+ }
170
+ }
171
+ }
172
+ }
173
+ // Get schema (which will build it with all registered operations)
79
174
  const schema = getGraphQLSchema();
80
175
  if (!schema) {
81
- throw new Error('Could not generate GraphQL schema. Please ensure slingr-framework is properly installed.');
176
+ throw new Error('Could not generate GraphQL schema. Please ensure @slingr/framework-backend is properly installed.');
82
177
  }
83
178
  const schemaString = printSchema(schema);
84
179
  // Ensure generated/gql directory exists
@@ -88,8 +183,24 @@ async function generateSchema() {
88
183
  }
89
184
  // Write schema to file
90
185
  const schemaFilePath = path_1.default.join(generatedDir, 'schema.graphql');
91
- fs_1.default.writeFileSync(schemaFilePath, schemaString, 'utf8');
92
- console.log(`āœ… GraphQL schema generated successfully at: ${schemaFilePath}`);
186
+ try {
187
+ fs_1.default.writeFileSync(schemaFilePath, schemaString, 'utf8');
188
+ }
189
+ catch (writeError) {
190
+ const msg = writeError instanceof Error ? writeError.message : String(writeError);
191
+ console.error(`āŒ Failed to write schema file at ${schemaFilePath}: ${msg}`);
192
+ throw writeError instanceof Error ? writeError : new Error(msg);
193
+ }
194
+ // Verify file creation and log size
195
+ try {
196
+ const stats = fs_1.default.statSync(schemaFilePath);
197
+ console.log(`āœ… GraphQL schema written: ${schemaFilePath} (${stats.size} bytes)`);
198
+ }
199
+ catch (statError) {
200
+ const msg = statError instanceof Error ? statError.message : String(statError);
201
+ console.warn(`āš ļø Schema file write succeeded but verification failed: ${msg}`);
202
+ console.log(`ā„¹ļø Please check that the path exists and you have write permissions: ${schemaFilePath}`);
203
+ }
93
204
  // Show a preview of the generated schema
94
205
  const lines = schemaString.split('\n');
95
206
  if (lines.length > 0) {
@@ -99,26 +210,9 @@ async function generateSchema() {
99
210
  console.log(`... (${lines.length - 15} more lines)`);
100
211
  }
101
212
  }
102
- // Check for --no-exit parameter
103
- const noExit = process.argv.includes('--no-exit');
104
- if (noExit) {
105
- console.log('\n Starting Apollo Server to explore the schema...');
106
- console.log('šŸ’” Remove --no-exit parameter to exit immediately after generating schema.');
107
- // Start Apollo Server for schema exploration
108
- const { startGraphQLServer } = slingrFramework;
109
- await startGraphQLServer({
110
- port: 4000,
111
- enableExplorer: true,
112
- });
113
- console.log('🌐 Apollo Explorer available at: http://localhost:4000/graphql');
114
- console.log('šŸ“– GraphQL schema introspection enabled');
115
- console.log('ā¹ļø Press Ctrl+C to stop the server');
116
- }
117
- else {
118
- console.log('\nāœ… Schema generation completed. Script will terminate now.');
119
- console.log('šŸ’” Use --no-exit parameter to start Apollo Server and explore the schema.');
120
- process.exit(0);
121
- }
213
+ await (0, temp_generate_metadata_1.generateMetadataFile)();
214
+ console.log('\nāœ… Schema generation completed. Script will terminate now.');
215
+ process.exit(0);
122
216
  }
123
217
  catch (error) {
124
218
  console.error(`Failed to generate schema: ${error.message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"generate-schema.js","sourceRoot":"","sources":["../../src/scripts/generate-schema.ts"],"names":[],"mappings":";;AACA;;;;;;GA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