@ankhorage/studio 2.7.0 → 2.7.2

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 (46) hide show
  1. package/README.md +1 -1
  2. package/apm/update.json +1 -1
  3. package/dist/features/project-updates/adapters/inbound/registerProjectUpdateRoutes.d.ts +16 -0
  4. package/dist/features/project-updates/adapters/inbound/registerProjectUpdateRoutes.d.ts.map +1 -0
  5. package/dist/features/project-updates/adapters/inbound/registerProjectUpdateRoutes.js +269 -0
  6. package/dist/features/project-updates/adapters/inbound/registerProjectUpdateRoutes.js.map +1 -0
  7. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts +29 -0
  8. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts.map +1 -0
  9. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js +116 -0
  10. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js.map +1 -0
  11. package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts +4 -0
  12. package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts.map +1 -0
  13. package/dist/features/projects/composition/createProjectGenerationStateStore.js +6 -0
  14. package/dist/features/projects/composition/createProjectGenerationStateStore.js.map +1 -0
  15. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts +4 -0
  16. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts.map +1 -0
  17. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js +17 -0
  18. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js.map +1 -0
  19. package/dist/host/http/projectRuntimeRoutes.d.ts +2 -2
  20. package/dist/host/http/projectRuntimeRoutes.d.ts.map +1 -1
  21. package/dist/host/http/projectRuntimeRoutes.js +12 -2
  22. package/dist/host/http/projectRuntimeRoutes.js.map +1 -1
  23. package/dist/host/http/server.d.ts +3 -1
  24. package/dist/host/http/server.d.ts.map +1 -1
  25. package/dist/host/http/server.js +16 -1
  26. package/dist/host/http/server.js.map +1 -1
  27. package/dist/host/index.d.ts +1 -0
  28. package/dist/host/index.d.ts.map +1 -1
  29. package/dist/host/index.js.map +1 -1
  30. package/dist/host/orchestrator/projectManager.d.ts +5 -0
  31. package/dist/host/orchestrator/projectManager.d.ts.map +1 -1
  32. package/dist/host/orchestrator/projectManager.js +41 -14
  33. package/dist/host/orchestrator/projectManager.js.map +1 -1
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/types/project-generation.d.ts +11 -0
  39. package/dist/types/project-generation.d.ts.map +1 -0
  40. package/dist/types/project-generation.js +2 -0
  41. package/dist/types/project-generation.js.map +1 -0
  42. package/package.json +1 -1
  43. package/dist/host/orchestrator/projectGenerationState.d.ts +0 -11
  44. package/dist/host/orchestrator/projectGenerationState.d.ts.map +0 -1
  45. package/dist/host/orchestrator/projectGenerationState.js +0 -65
  46. package/dist/host/orchestrator/projectGenerationState.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/studio",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "Studio authoring package for Ankhorage apps",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ankhorage/studio#readme",
@@ -1,11 +0,0 @@
1
- /***
2
- * Read whether the current generated project state includes the Studio admin surface.
3
- * @todo Move generation-state persistence from generic `host/orchestrator` into the `projects/` generation domain.
4
- */
5
- export declare function readProjectStudioInclusion(projectPath: string): Promise<boolean>;
6
- /***
7
- * Atomically persist whether the current generated project state includes the Studio admin surface.
8
- * @todo Keep this domain wrapper in `projects/`; the generic atomic JSON write primitive can move to Utility.
9
- */
10
- export declare function writeProjectStudioInclusion(projectPath: string, includeStudio: boolean): Promise<void>;
11
- //# sourceMappingURL=projectGenerationState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projectGenerationState.d.ts","sourceRoot":"","sources":["../../../src/host/orchestrator/projectGenerationState.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAItF;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -1,65 +0,0 @@
1
- import { isMissingPathError, writeJsonFileAtomic } from '@ankhorage/utility/node/fs';
2
- import { isRecord } from '@ankhorage/utility/object';
3
- import { promises as fs } from 'fs';
4
- import path from 'path';
5
- const PROJECT_GENERATION_STATE_REL_PATH = '.ankh/generation-state.json';
6
- /***
7
- * Read whether the current generated project state includes the Studio admin surface.
8
- * @todo Move generation-state persistence from generic `host/orchestrator` into the `projects/` generation domain.
9
- */
10
- export async function readProjectStudioInclusion(projectPath) {
11
- const statePath = resolveProjectFile(projectPath, PROJECT_GENERATION_STATE_REL_PATH);
12
- const state = await readProjectGenerationState(statePath);
13
- return state.includeStudio;
14
- }
15
- /***
16
- * Atomically persist whether the current generated project state includes the Studio admin surface.
17
- * @todo Keep this domain wrapper in `projects/`; the generic atomic JSON write primitive can move to Utility.
18
- */
19
- export async function writeProjectStudioInclusion(projectPath, includeStudio) {
20
- const state = { includeStudio };
21
- const statePath = resolveProjectFile(projectPath, PROJECT_GENERATION_STATE_REL_PATH);
22
- await writeJsonFileAtomic(statePath, state);
23
- }
24
- /*** Read, parse, and validate the required Studio project-generation state document. */
25
- async function readProjectGenerationState(statePath) {
26
- let source;
27
- try {
28
- source = await fs.readFile(statePath, 'utf8');
29
- }
30
- catch (error) {
31
- if (isMissingPathError(error)) {
32
- throw new Error(`Project generation state is missing at '${statePath}'. Run an explicit project sync with includeStudio set before using implicit runtime sync.`, { cause: error });
33
- }
34
- throw error;
35
- }
36
- let parsed;
37
- try {
38
- parsed = JSON.parse(source);
39
- }
40
- catch (error) {
41
- throw new Error(`Project generation state is invalid at '${statePath}'.`, { cause: error });
42
- }
43
- if (!isProjectGenerationState(parsed)) {
44
- throw new Error(`Project generation state is invalid at '${statePath}'.`);
45
- }
46
- return parsed;
47
- }
48
- /*** Validate the semantic shape of a persisted Studio project-generation state document. */
49
- function isProjectGenerationState(value) {
50
- return isRecord(value) && typeof value.includeStudio === 'boolean';
51
- }
52
- /***
53
- * Resolve a relative path beneath a root and reject absolute or escaping paths.
54
- * @utility @ankhorage/utility/node/path
55
- */
56
- function resolveProjectFile(projectPath, relativePath) {
57
- const root = path.resolve(projectPath);
58
- const target = path.resolve(root, relativePath);
59
- const relative = path.relative(root, target);
60
- if (relative.startsWith('..') || path.isAbsolute(relative)) {
61
- throw new Error(`Invalid project generation state path: ${relativePath}`);
62
- }
63
- return target;
64
- }
65
- //# sourceMappingURL=projectGenerationState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projectGenerationState.js","sourceRoot":"","sources":["../../../src/host/orchestrator/projectGenerationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAMxE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,WAAmB;IAClE,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;IACrF,MAAM,KAAK,GAAG,MAAM,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,aAAa,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,WAAmB,EACnB,aAAsB;IAEt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