@studio-foundation/cli 0.3.0-beta.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 (277) hide show
  1. package/ARCHITECTURE.md +40 -0
  2. package/LICENSE +663 -0
  3. package/README.md +165 -0
  4. package/dist/commands/api.d.ts +16 -0
  5. package/dist/commands/api.d.ts.map +1 -0
  6. package/dist/commands/api.js +118 -0
  7. package/dist/commands/api.js.map +1 -0
  8. package/dist/commands/config.d.ts +32 -0
  9. package/dist/commands/config.d.ts.map +1 -0
  10. package/dist/commands/config.js +390 -0
  11. package/dist/commands/config.js.map +1 -0
  12. package/dist/commands/init.d.ts +93 -0
  13. package/dist/commands/init.d.ts.map +1 -0
  14. package/dist/commands/init.js +728 -0
  15. package/dist/commands/init.js.map +1 -0
  16. package/dist/commands/install.d.ts +2 -0
  17. package/dist/commands/install.d.ts.map +1 -0
  18. package/dist/commands/install.js +22 -0
  19. package/dist/commands/install.js.map +1 -0
  20. package/dist/commands/integrations.d.ts +14 -0
  21. package/dist/commands/integrations.d.ts.map +1 -0
  22. package/dist/commands/integrations.js +282 -0
  23. package/dist/commands/integrations.js.map +1 -0
  24. package/dist/commands/list.d.ts +9 -0
  25. package/dist/commands/list.d.ts.map +1 -0
  26. package/dist/commands/list.js +161 -0
  27. package/dist/commands/list.js.map +1 -0
  28. package/dist/commands/logs.d.ts +7 -0
  29. package/dist/commands/logs.d.ts.map +1 -0
  30. package/dist/commands/logs.js +98 -0
  31. package/dist/commands/logs.js.map +1 -0
  32. package/dist/commands/ollama.d.ts +6 -0
  33. package/dist/commands/ollama.d.ts.map +1 -0
  34. package/dist/commands/ollama.js +161 -0
  35. package/dist/commands/ollama.js.map +1 -0
  36. package/dist/commands/project.d.ts +38 -0
  37. package/dist/commands/project.d.ts.map +1 -0
  38. package/dist/commands/project.js +137 -0
  39. package/dist/commands/project.js.map +1 -0
  40. package/dist/commands/registry/audit.d.ts +13 -0
  41. package/dist/commands/registry/audit.d.ts.map +1 -0
  42. package/dist/commands/registry/audit.js +65 -0
  43. package/dist/commands/registry/audit.js.map +1 -0
  44. package/dist/commands/registry/index.d.ts +3 -0
  45. package/dist/commands/registry/index.d.ts.map +1 -0
  46. package/dist/commands/registry/index.js +53 -0
  47. package/dist/commands/registry/index.js.map +1 -0
  48. package/dist/commands/registry/install.d.ts +17 -0
  49. package/dist/commands/registry/install.d.ts.map +1 -0
  50. package/dist/commands/registry/install.js +153 -0
  51. package/dist/commands/registry/install.js.map +1 -0
  52. package/dist/commands/registry/publish.d.ts +8 -0
  53. package/dist/commands/registry/publish.d.ts.map +1 -0
  54. package/dist/commands/registry/publish.js +94 -0
  55. package/dist/commands/registry/publish.js.map +1 -0
  56. package/dist/commands/registry/remove.d.ts +8 -0
  57. package/dist/commands/registry/remove.d.ts.map +1 -0
  58. package/dist/commands/registry/remove.js +82 -0
  59. package/dist/commands/registry/remove.js.map +1 -0
  60. package/dist/commands/registry/search.d.ts +9 -0
  61. package/dist/commands/registry/search.d.ts.map +1 -0
  62. package/dist/commands/registry/search.js +68 -0
  63. package/dist/commands/registry/search.js.map +1 -0
  64. package/dist/commands/registry/sync.d.ts +8 -0
  65. package/dist/commands/registry/sync.d.ts.map +1 -0
  66. package/dist/commands/registry/sync.js +19 -0
  67. package/dist/commands/registry/sync.js.map +1 -0
  68. package/dist/commands/registry/update.d.ts +15 -0
  69. package/dist/commands/registry/update.d.ts.map +1 -0
  70. package/dist/commands/registry/update.js +48 -0
  71. package/dist/commands/registry/update.js.map +1 -0
  72. package/dist/commands/replay.d.ts +36 -0
  73. package/dist/commands/replay.d.ts.map +1 -0
  74. package/dist/commands/replay.js +453 -0
  75. package/dist/commands/replay.js.map +1 -0
  76. package/dist/commands/run.d.ts +18 -0
  77. package/dist/commands/run.d.ts.map +1 -0
  78. package/dist/commands/run.js +406 -0
  79. package/dist/commands/run.js.map +1 -0
  80. package/dist/commands/status.d.ts +6 -0
  81. package/dist/commands/status.d.ts.map +1 -0
  82. package/dist/commands/status.js +144 -0
  83. package/dist/commands/status.js.map +1 -0
  84. package/dist/commands/template/index.d.ts +2 -0
  85. package/dist/commands/template/index.d.ts.map +1 -0
  86. package/dist/commands/template/index.js +57 -0
  87. package/dist/commands/template/index.js.map +1 -0
  88. package/dist/commands/template/validate.d.ts +8 -0
  89. package/dist/commands/template/validate.d.ts.map +1 -0
  90. package/dist/commands/template/validate.js +135 -0
  91. package/dist/commands/template/validate.js.map +1 -0
  92. package/dist/commands/templates.d.ts +14 -0
  93. package/dist/commands/templates.d.ts.map +1 -0
  94. package/dist/commands/templates.js +86 -0
  95. package/dist/commands/templates.js.map +1 -0
  96. package/dist/commands/tools.d.ts +12 -0
  97. package/dist/commands/tools.d.ts.map +1 -0
  98. package/dist/commands/tools.js +200 -0
  99. package/dist/commands/tools.js.map +1 -0
  100. package/dist/commands/users.d.ts +4 -0
  101. package/dist/commands/users.d.ts.map +1 -0
  102. package/dist/commands/users.js +123 -0
  103. package/dist/commands/users.js.map +1 -0
  104. package/dist/commands/validate.d.ts +2 -0
  105. package/dist/commands/validate.d.ts.map +1 -0
  106. package/dist/commands/validate.js +39 -0
  107. package/dist/commands/validate.js.map +1 -0
  108. package/dist/config.d.ts +36 -0
  109. package/dist/config.d.ts.map +1 -0
  110. package/dist/config.js +64 -0
  111. package/dist/config.js.map +1 -0
  112. package/dist/index.d.ts +3 -0
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +178 -0
  115. package/dist/index.js.map +1 -0
  116. package/dist/models-cache.d.ts +13 -0
  117. package/dist/models-cache.d.ts.map +1 -0
  118. package/dist/models-cache.js +106 -0
  119. package/dist/models-cache.js.map +1 -0
  120. package/dist/output/file-changes.d.ts +15 -0
  121. package/dist/output/file-changes.d.ts.map +1 -0
  122. package/dist/output/file-changes.js +77 -0
  123. package/dist/output/file-changes.js.map +1 -0
  124. package/dist/output/formatter.d.ts +6 -0
  125. package/dist/output/formatter.d.ts.map +1 -0
  126. package/dist/output/formatter.js +70 -0
  127. package/dist/output/formatter.js.map +1 -0
  128. package/dist/output/formatters.d.ts +42 -0
  129. package/dist/output/formatters.d.ts.map +1 -0
  130. package/dist/output/formatters.js +280 -0
  131. package/dist/output/formatters.js.map +1 -0
  132. package/dist/output/logger.d.ts +3 -0
  133. package/dist/output/logger.d.ts.map +1 -0
  134. package/dist/output/logger.js +15 -0
  135. package/dist/output/logger.js.map +1 -0
  136. package/dist/output/parallel-progress.d.ts +33 -0
  137. package/dist/output/parallel-progress.d.ts.map +1 -0
  138. package/dist/output/parallel-progress.js +85 -0
  139. package/dist/output/parallel-progress.js.map +1 -0
  140. package/dist/output/progress.d.ts +32 -0
  141. package/dist/output/progress.d.ts.map +1 -0
  142. package/dist/output/progress.js +393 -0
  143. package/dist/output/progress.js.map +1 -0
  144. package/dist/provider-validator.d.ts +15 -0
  145. package/dist/provider-validator.d.ts.map +1 -0
  146. package/dist/provider-validator.js +85 -0
  147. package/dist/provider-validator.js.map +1 -0
  148. package/dist/registry/cache.d.ts +10 -0
  149. package/dist/registry/cache.d.ts.map +1 -0
  150. package/dist/registry/cache.js +36 -0
  151. package/dist/registry/cache.js.map +1 -0
  152. package/dist/registry/client.d.ts +19 -0
  153. package/dist/registry/client.d.ts.map +1 -0
  154. package/dist/registry/client.js +63 -0
  155. package/dist/registry/client.js.map +1 -0
  156. package/dist/registry/lockfile.d.ts +17 -0
  157. package/dist/registry/lockfile.d.ts.map +1 -0
  158. package/dist/registry/lockfile.js +61 -0
  159. package/dist/registry/lockfile.js.map +1 -0
  160. package/dist/registry/resolver.d.ts +13 -0
  161. package/dist/registry/resolver.d.ts.map +1 -0
  162. package/dist/registry/resolver.js +79 -0
  163. package/dist/registry/resolver.js.map +1 -0
  164. package/dist/registry/types.d.ts +59 -0
  165. package/dist/registry/types.d.ts.map +1 -0
  166. package/dist/registry/types.js +14 -0
  167. package/dist/registry/types.js.map +1 -0
  168. package/dist/run-logger.d.ts +8 -0
  169. package/dist/run-logger.d.ts.map +1 -0
  170. package/dist/run-logger.js +53 -0
  171. package/dist/run-logger.js.map +1 -0
  172. package/dist/run-store-factory.d.ts +9 -0
  173. package/dist/run-store-factory.d.ts.map +1 -0
  174. package/dist/run-store-factory.js +26 -0
  175. package/dist/run-store-factory.js.map +1 -0
  176. package/dist/studio-dir.d.ts +7 -0
  177. package/dist/studio-dir.d.ts.map +1 -0
  178. package/dist/studio-dir.js +27 -0
  179. package/dist/studio-dir.js.map +1 -0
  180. package/dist/utils/input-wizard.d.ts +4 -0
  181. package/dist/utils/input-wizard.d.ts.map +1 -0
  182. package/dist/utils/input-wizard.js +56 -0
  183. package/dist/utils/input-wizard.js.map +1 -0
  184. package/dist/utils/placeholders.d.ts +6 -0
  185. package/dist/utils/placeholders.d.ts.map +1 -0
  186. package/dist/utils/placeholders.js +12 -0
  187. package/dist/utils/placeholders.js.map +1 -0
  188. package/package.json +43 -0
  189. package/src/commands/api.ts +126 -0
  190. package/src/commands/config.ts +433 -0
  191. package/src/commands/init.ts +879 -0
  192. package/src/commands/install.ts +23 -0
  193. package/src/commands/integrations.ts +332 -0
  194. package/src/commands/list.ts +197 -0
  195. package/src/commands/logs.ts +119 -0
  196. package/src/commands/ollama.ts +168 -0
  197. package/src/commands/project.ts +167 -0
  198. package/src/commands/registry/audit.ts +87 -0
  199. package/src/commands/registry/index.ts +63 -0
  200. package/src/commands/registry/install.ts +222 -0
  201. package/src/commands/registry/publish.ts +112 -0
  202. package/src/commands/registry/remove.ts +89 -0
  203. package/src/commands/registry/search.ts +93 -0
  204. package/src/commands/registry/sync.ts +24 -0
  205. package/src/commands/registry/update.ts +63 -0
  206. package/src/commands/replay.ts +559 -0
  207. package/src/commands/run.ts +454 -0
  208. package/src/commands/status.ts +163 -0
  209. package/src/commands/template/index.ts +59 -0
  210. package/src/commands/template/validate.ts +175 -0
  211. package/src/commands/templates.ts +99 -0
  212. package/src/commands/tools.ts +227 -0
  213. package/src/commands/users.ts +127 -0
  214. package/src/commands/validate.ts +46 -0
  215. package/src/config.ts +101 -0
  216. package/src/index.ts +201 -0
  217. package/src/models-cache.ts +127 -0
  218. package/src/output/file-changes.ts +97 -0
  219. package/src/output/formatter.ts +85 -0
  220. package/src/output/formatters.ts +303 -0
  221. package/src/output/logger.ts +18 -0
  222. package/src/output/parallel-progress.ts +103 -0
  223. package/src/output/progress.ts +414 -0
  224. package/src/provider-validator.ts +109 -0
  225. package/src/registry/cache.ts +46 -0
  226. package/src/registry/client.ts +84 -0
  227. package/src/registry/lockfile.ts +68 -0
  228. package/src/registry/resolver.ts +113 -0
  229. package/src/registry/types.ts +66 -0
  230. package/src/run-logger.ts +66 -0
  231. package/src/run-store-factory.ts +30 -0
  232. package/src/studio-dir.ts +28 -0
  233. package/src/utils/input-wizard.ts +73 -0
  234. package/src/utils/placeholders.ts +10 -0
  235. package/templates/.studiorc.yaml +16 -0
  236. package/templates/projects/blank/metadata.json +7 -0
  237. package/templates/studio-config.yaml +14 -0
  238. package/tests/__stubs__/studio-runner.ts +104 -0
  239. package/tests/commands/api.test.ts +110 -0
  240. package/tests/commands/config.test.ts +221 -0
  241. package/tests/commands/init.test.ts +919 -0
  242. package/tests/commands/install.test.ts +52 -0
  243. package/tests/commands/integrations.test.ts +158 -0
  244. package/tests/commands/ollama.test.ts +139 -0
  245. package/tests/commands/project.test.ts +179 -0
  246. package/tests/commands/registry/audit.test.ts +56 -0
  247. package/tests/commands/registry/install.test.ts +200 -0
  248. package/tests/commands/registry/publish.test.ts +56 -0
  249. package/tests/commands/registry/remove.test.ts +103 -0
  250. package/tests/commands/registry/search.test.ts +44 -0
  251. package/tests/commands/registry/sync.test.ts +37 -0
  252. package/tests/commands/registry/update.test.ts +62 -0
  253. package/tests/commands/replay.test.ts +283 -0
  254. package/tests/commands/template/validate.test.ts +150 -0
  255. package/tests/commands/templates.test.ts +42 -0
  256. package/tests/commands/tools.test.ts +106 -0
  257. package/tests/config.test.ts +142 -0
  258. package/tests/formatter.test.ts +158 -0
  259. package/tests/integration/sigint.test.ts +188 -0
  260. package/tests/models-cache.test.ts +250 -0
  261. package/tests/output/file-changes.test.ts +178 -0
  262. package/tests/output/formatters.test.ts +448 -0
  263. package/tests/output/progress-spinner.test.ts +232 -0
  264. package/tests/output/progress-timer.test.ts +230 -0
  265. package/tests/provider-validator.test.ts +182 -0
  266. package/tests/registry/cache.test.ts +66 -0
  267. package/tests/registry/client.test.ts +70 -0
  268. package/tests/registry/lockfile.test.ts +87 -0
  269. package/tests/registry/resolver.test.ts +122 -0
  270. package/tests/run-logger-events.test.ts +326 -0
  271. package/tests/run-logger.test.ts +64 -0
  272. package/tests/run-store-factory.test.ts +51 -0
  273. package/tests/studio-dir.test.ts +31 -0
  274. package/tests/utils/input-wizard.test.ts +153 -0
  275. package/tests/utils/placeholders.test.ts +36 -0
  276. package/tsconfig.json +24 -0
  277. package/vitest.config.ts +20 -0
@@ -0,0 +1,153 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+ import type { InputSchema } from '@studio-foundation/contracts';
3
+ import { collectStructuredInput } from '../../src/utils/input-wizard.js';
4
+
5
+ // Mock @inquirer/prompts at module level
6
+ vi.mock('@inquirer/prompts', () => ({
7
+ input: vi.fn(),
8
+ }));
9
+ import { validateInputSchema } from '../../src/utils/input-wizard.js';
10
+
11
+ describe('validateInputSchema', () => {
12
+ it('accepts a valid text field', () => {
13
+ const result = validateInputSchema({
14
+ type: 'structured',
15
+ fields: [{ name: 'brief_summary', type: 'text', prompt: 'Brief summary', required: true }],
16
+ });
17
+ expect(result.fields).toHaveLength(1);
18
+ expect(result.fields[0].name).toBe('brief_summary');
19
+ });
20
+
21
+ it('accepts a valid array field', () => {
22
+ const result = validateInputSchema({
23
+ type: 'structured',
24
+ fields: [{ name: 'criteria', type: 'array', items: 'text', prompt: 'Criteria', required: true }],
25
+ });
26
+ expect(result.fields[0].type).toBe('array');
27
+ });
28
+
29
+ it('accepts an optional field with a default', () => {
30
+ const result = validateInputSchema({
31
+ type: 'structured',
32
+ fields: [{ name: 'page', type: 'text', prompt: 'Target page', required: false, default: 'src/index.ts' }],
33
+ });
34
+ expect(result.fields[0].default).toBe('src/index.ts');
35
+ });
36
+
37
+ it('throws when fields is missing', () => {
38
+ expect(() => validateInputSchema({ type: 'structured' })).toThrow(
39
+ 'input_schema must have at least one field'
40
+ );
41
+ });
42
+
43
+ it('throws when fields is empty', () => {
44
+ expect(() => validateInputSchema({ type: 'structured', fields: [] })).toThrow(
45
+ 'input_schema must have at least one field'
46
+ );
47
+ });
48
+
49
+ it('throws when a field is missing prompt', () => {
50
+ expect(() =>
51
+ validateInputSchema({
52
+ type: 'structured',
53
+ fields: [{ name: 'foo', type: 'text', required: true }],
54
+ })
55
+ ).toThrow("Field 'foo' must have a non-empty 'prompt'");
56
+ });
57
+
58
+ it('throws when a field has empty prompt', () => {
59
+ expect(() =>
60
+ validateInputSchema({
61
+ type: 'structured',
62
+ fields: [{ name: 'foo', type: 'text', prompt: ' ', required: true }],
63
+ })
64
+ ).toThrow("Field 'foo' must have a non-empty 'prompt'");
65
+ });
66
+
67
+ it('throws when a field has invalid type', () => {
68
+ expect(() =>
69
+ validateInputSchema({
70
+ type: 'structured',
71
+ fields: [{ name: 'foo', type: 'number', prompt: 'Foo', required: true }],
72
+ })
73
+ ).toThrow("Field 'foo' has invalid type 'number'. Must be 'text' or 'array'");
74
+ });
75
+
76
+ it('throws when an array field is missing items', () => {
77
+ expect(() =>
78
+ validateInputSchema({
79
+ type: 'structured',
80
+ fields: [{ name: 'foo', type: 'array', prompt: 'Foo', required: true }],
81
+ })
82
+ ).toThrow("Array field 'foo' must have items: 'text'");
83
+ });
84
+
85
+ it('throws when an array field has non-text items', () => {
86
+ expect(() =>
87
+ validateInputSchema({
88
+ type: 'structured',
89
+ fields: [{ name: 'foo', type: 'array', items: 'number', prompt: 'Foo', required: true }],
90
+ })
91
+ ).toThrow("Array field 'foo' must have items: 'text'");
92
+ });
93
+ });
94
+
95
+ describe('collectStructuredInput', () => {
96
+ beforeEach(() => {
97
+ vi.clearAllMocks();
98
+ });
99
+
100
+ it('collects a single text field', async () => {
101
+ const { input: mockInput } = await import('@inquirer/prompts');
102
+ (mockInput as ReturnType<typeof vi.fn>).mockResolvedValueOnce('Add dark mode');
103
+
104
+ const schema: InputSchema = {
105
+ type: 'structured',
106
+ fields: [{ name: 'brief_summary', type: 'text', prompt: 'Brief summary', required: true }],
107
+ };
108
+
109
+ const result = await collectStructuredInput(schema);
110
+
111
+ expect(result).toEqual({ brief_summary: 'Add dark mode' });
112
+ expect(mockInput).toHaveBeenCalledWith(
113
+ expect.objectContaining({ message: 'Brief summary' })
114
+ );
115
+ });
116
+
117
+ it('collects an array field with multiple entries', async () => {
118
+ const { input: mockInput } = await import('@inquirer/prompts');
119
+ (mockInput as ReturnType<typeof vi.fn>)
120
+ .mockResolvedValueOnce('First criterion')
121
+ .mockResolvedValueOnce('Second criterion')
122
+ .mockResolvedValueOnce(''); // empty → stop
123
+
124
+ const schema: InputSchema = {
125
+ type: 'structured',
126
+ fields: [{ name: 'criteria', type: 'array', items: 'text', prompt: 'Criteria', required: true }],
127
+ };
128
+
129
+ const result = await collectStructuredInput(schema);
130
+
131
+ expect(result).toEqual({ criteria: ['First criterion', 'Second criterion'] });
132
+ });
133
+
134
+ it('collects multiple fields', async () => {
135
+ const { input: mockInput } = await import('@inquirer/prompts');
136
+ (mockInput as ReturnType<typeof vi.fn>)
137
+ .mockResolvedValueOnce('Add dark mode') // text field
138
+ .mockResolvedValueOnce('Must work') // array entry 1
139
+ .mockResolvedValueOnce(''); // array stop
140
+
141
+ const schema: InputSchema = {
142
+ type: 'structured',
143
+ fields: [
144
+ { name: 'summary', type: 'text', prompt: 'Summary', required: true },
145
+ { name: 'criteria', type: 'array', items: 'text', prompt: 'Criteria', required: true },
146
+ ],
147
+ };
148
+
149
+ const result = await collectStructuredInput(schema);
150
+
151
+ expect(result).toEqual({ summary: 'Add dark mode', criteria: ['Must work'] });
152
+ });
153
+ });
@@ -0,0 +1,36 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { applyPlaceholders } from '../../src/utils/placeholders.js';
3
+
4
+ describe('applyPlaceholders', () => {
5
+ it('replaces a single known placeholder', () => {
6
+ expect(applyPlaceholders('Hello {{PROJECT_NAME}}', { PROJECT_NAME: 'my-app' }))
7
+ .toBe('Hello my-app');
8
+ });
9
+
10
+ it('replaces multiple placeholders in one pass', () => {
11
+ const result = applyPlaceholders(
12
+ 'name: {{PROJECT_NAME}}\ntemplate: {{TEMPLATE_NAME}}\nyear: {{YEAR}}',
13
+ { PROJECT_NAME: 'x', TEMPLATE_NAME: 'software', YEAR: '2026' }
14
+ );
15
+ expect(result).toBe('name: x\ntemplate: software\nyear: 2026');
16
+ });
17
+
18
+ it('replaces the same placeholder multiple times', () => {
19
+ expect(applyPlaceholders('{{PROJECT_NAME}} / {{PROJECT_NAME}}', { PROJECT_NAME: 'app' }))
20
+ .toBe('app / app');
21
+ });
22
+
23
+ it('throws on unresolved placeholder', () => {
24
+ expect(() => applyPlaceholders('{{UNKNOWN}}', {}))
25
+ .toThrow('Unresolved placeholder: {{UNKNOWN}}');
26
+ });
27
+
28
+ it('returns content unchanged when no placeholders', () => {
29
+ expect(applyPlaceholders('no placeholders here', {})).toBe('no placeholders here');
30
+ });
31
+
32
+ it('does not replace lowercase or mixed-case patterns', () => {
33
+ // Only {{ALL_CAPS_WITH_UNDERSCORES}} are treated as placeholders
34
+ expect(applyPlaceholders('{{lowercase}}', {})).toBe('{{lowercase}}');
35
+ });
36
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "bundler",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "declaration": true,
9
+ "declarationMap": true,
10
+ "sourceMap": true,
11
+ "strict": true,
12
+ "esModuleInterop": true,
13
+ "skipLibCheck": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "noImplicitReturns": true,
20
+ "noFallthroughCasesInSwitch": true
21
+ },
22
+ "include": ["src/**/*"],
23
+ "exclude": ["node_modules", "dist", "tests"]
24
+ }
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import { resolve } from 'node:path';
3
+ import { existsSync } from 'node:fs';
4
+
5
+ // Use a stub only when @studio/runner has not been built (e.g. a fresh git worktree).
6
+ // When dist/ exists (CI, main checkout) the real package is used so that transitive
7
+ // imports from other packages (e.g. @studio/api) continue to resolve correctly.
8
+ const runnerDist = resolve(import.meta.dirname, '../runner/dist/index.js');
9
+ const runnerAlias = existsSync(runnerDist) ? {} : {
10
+ '@studio-foundation/runner': resolve(import.meta.dirname, 'tests/__stubs__/studio-runner.ts'),
11
+ };
12
+
13
+ export default defineConfig({
14
+ resolve: {
15
+ alias: runnerAlias,
16
+ },
17
+ test: {
18
+ include: ['tests/**/*.test.ts'],
19
+ },
20
+ });