@jakubmazanec/carson 0.1.0-c5ebb6f → 0.1.0-next.336fe21

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 (225) hide show
  1. package/README.md +65 -10
  2. package/dist/commands/create-project/CreateProject.js.map +1 -1
  3. package/dist/commands/create-project/CreateProjectInput.js +1 -1
  4. package/dist/commands/create-project/CreateProjectInput.js.map +1 -1
  5. package/dist/commands/create-project/createProjectCommand.js +3 -4
  6. package/dist/commands/create-project/createProjectCommand.js.map +1 -1
  7. package/dist/commands/create-project/runCreateProject.js +3 -13
  8. package/dist/commands/create-project/runCreateProject.js.map +1 -1
  9. package/dist/commands/create-workspace/CreateWorkspace.d.ts +1 -2
  10. package/dist/commands/create-workspace/CreateWorkspace.js +7 -5
  11. package/dist/commands/create-workspace/CreateWorkspace.js.map +1 -1
  12. package/dist/commands/create-workspace/createWorkspaceCommand.js +1 -11
  13. package/dist/commands/create-workspace/createWorkspaceCommand.js.map +1 -1
  14. package/dist/commands/create-workspace/runCreateWorkspace.js +3 -12
  15. package/dist/commands/create-workspace/runCreateWorkspace.js.map +1 -1
  16. package/dist/commands/internals/CommandStatus.d.ts +1 -0
  17. package/dist/commands/internals/CommandStatus.js +3 -0
  18. package/dist/commands/internals/CommandStatus.js.map +1 -0
  19. package/dist/commands/internals.d.ts +1 -0
  20. package/dist/commands/internals.js +1 -0
  21. package/dist/commands/internals.js.map +1 -1
  22. package/dist/commands/update-workspace/UpdateWorkspace.js +1 -1
  23. package/dist/commands/update-workspace/UpdateWorkspace.js.map +1 -1
  24. package/dist/commands/update-workspace/updateWorkspaceCommand.js +3 -4
  25. package/dist/commands/update-workspace/updateWorkspaceCommand.js.map +1 -1
  26. package/dist/template/CarsonTemplate.d.ts +1 -1
  27. package/dist/template/CarsonTemplate.js.map +1 -1
  28. package/dist/template/CarsonTemplateConfig.d.ts +1 -1
  29. package/dist/template/CarsonTemplateConfig.js.map +1 -1
  30. package/dist/template/CarsonTemplateError.d.ts +8 -0
  31. package/dist/template/CarsonTemplateError.js +13 -0
  32. package/dist/template/CarsonTemplateError.js.map +1 -0
  33. package/dist/template/TemplateAttributes.d.ts +3 -3
  34. package/dist/template/TemplateAttributes.js +2 -1
  35. package/dist/template/TemplateAttributes.js.map +1 -1
  36. package/dist/template/TemplateRender.d.ts +6 -2
  37. package/dist/template/TemplateRender.js.map +1 -1
  38. package/dist/template/TemplateRenders.d.ts +1 -1
  39. package/dist/template/TemplateRenders.js.map +1 -1
  40. package/dist/template/applyTemplateRenders.d.ts +3 -0
  41. package/dist/template/applyTemplateRenders.js +36 -6
  42. package/dist/template/applyTemplateRenders.js.map +1 -1
  43. package/dist/template/internals/TemplateRenderSnapshot.d.ts +18 -5
  44. package/dist/template/internals/TemplateRenderSnapshot.js +4 -1
  45. package/dist/template/internals/TemplateRenderSnapshot.js.map +1 -1
  46. package/dist/template/internals/TemplateRenderSnapshots.d.ts +18 -5
  47. package/dist/template/internals/deleteUsingTemplateRender.d.ts +4 -1
  48. package/dist/template/internals/deleteUsingTemplateRender.js +16 -3
  49. package/dist/template/internals/deleteUsingTemplateRender.js.map +1 -1
  50. package/dist/template/internals/insertUsingTemplateRender.js +11 -1
  51. package/dist/template/internals/insertUsingTemplateRender.js.map +1 -1
  52. package/dist/template/internals/loadTemplateRenderSnapshots.d.ts +4 -1
  53. package/dist/template/internals/mergeUsingTemplateRender.js +11 -1
  54. package/dist/template/internals/mergeUsingTemplateRender.js.map +1 -1
  55. package/dist/template/internals/parseCarsonTemplateId.js +6 -1
  56. package/dist/template/internals/parseCarsonTemplateId.js.map +1 -1
  57. package/dist/template/internals/readCarsonTemplate.js +7 -1
  58. package/dist/template/internals/readCarsonTemplate.js.map +1 -1
  59. package/dist/template/internals/saveTemplateRenderSnapshots.js +4 -4
  60. package/dist/template/internals/saveTemplateRenderSnapshots.js.map +1 -1
  61. package/dist/template/internals/uninsertUsingTemplateRender.js +11 -1
  62. package/dist/template/internals/uninsertUsingTemplateRender.js.map +1 -1
  63. package/dist/template/internals/unmerge.d.ts +1 -1
  64. package/dist/template/internals/unmerge.js +1 -1
  65. package/dist/template/internals/unmerge.js.map +1 -1
  66. package/dist/template/internals/unmergeUsingTemplateRender.js +11 -1
  67. package/dist/template/internals/unmergeUsingTemplateRender.js.map +1 -1
  68. package/dist/template/renderCarsonTemplate.d.ts +3 -0
  69. package/dist/template/renderCarsonTemplate.js +15 -4
  70. package/dist/template/renderCarsonTemplate.js.map +1 -1
  71. package/dist/template.d.ts +1 -0
  72. package/dist/template.js +1 -0
  73. package/dist/template.js.map +1 -1
  74. package/dist/workspace/Project.d.ts +2 -2
  75. package/dist/workspace/Project.js +19 -4
  76. package/dist/workspace/Project.js.map +1 -1
  77. package/dist/workspace/ProjectConfig.d.ts +3 -0
  78. package/dist/workspace/ProjectConfig.js.map +1 -1
  79. package/dist/workspace/ProjectCreateOptions.d.ts +3 -0
  80. package/dist/workspace/ProjectCreateOptions.js.map +1 -1
  81. package/dist/workspace/ProjectError.d.ts +5 -2
  82. package/dist/workspace/ProjectError.js +6 -2
  83. package/dist/workspace/ProjectError.js.map +1 -1
  84. package/dist/workspace/ProjectOptions.d.ts +1 -1
  85. package/dist/workspace/ProjectOptions.js.map +1 -1
  86. package/dist/workspace/ProjectUpdateOptions.d.ts +3 -0
  87. package/dist/workspace/ProjectUpdateOptions.js +3 -1
  88. package/dist/workspace/ProjectUpdateOptions.js.map +1 -1
  89. package/dist/workspace/Workspace.d.ts +8 -6
  90. package/dist/workspace/Workspace.js +106 -33
  91. package/dist/workspace/Workspace.js.map +1 -1
  92. package/dist/workspace/WorkspaceConfig.d.ts +3 -0
  93. package/dist/workspace/WorkspaceConfig.js.map +1 -1
  94. package/dist/workspace/WorkspaceCreateOptions.d.ts +3 -0
  95. package/dist/workspace/WorkspaceCreateOptions.js +3 -1
  96. package/dist/workspace/WorkspaceCreateOptions.js.map +1 -1
  97. package/dist/workspace/WorkspaceCreateProjectOptions.d.ts +3 -0
  98. package/dist/workspace/WorkspaceCreateProjectOptions.js +3 -1
  99. package/dist/workspace/WorkspaceCreateProjectOptions.js.map +1 -1
  100. package/dist/workspace/WorkspaceDependencies.d.ts +26 -19
  101. package/dist/workspace/WorkspaceDependencies.js +27 -9
  102. package/dist/workspace/WorkspaceDependencies.js.map +1 -1
  103. package/dist/workspace/WorkspaceDependenciesFromWorkspaceOptions.d.ts +8 -0
  104. package/dist/workspace/WorkspaceDependenciesFromWorkspaceOptions.js +5 -0
  105. package/dist/workspace/WorkspaceDependenciesFromWorkspaceOptions.js.map +1 -0
  106. package/dist/workspace/WorkspaceDependenciesGetVersionsOptions.d.ts +6 -0
  107. package/dist/workspace/WorkspaceDependenciesGetVersionsOptions.js +5 -0
  108. package/dist/workspace/WorkspaceDependenciesGetVersionsOptions.js.map +1 -0
  109. package/dist/workspace/WorkspaceDependency.d.ts +14 -0
  110. package/dist/workspace/WorkspaceDependency.js +3 -0
  111. package/dist/workspace/WorkspaceDependency.js.map +1 -0
  112. package/dist/workspace/WorkspaceDependencyProject.d.ts +11 -0
  113. package/dist/workspace/WorkspaceDependencyProject.js +5 -0
  114. package/dist/workspace/WorkspaceDependencyProject.js.map +1 -0
  115. package/dist/workspace/WorkspaceError.d.ts +5 -2
  116. package/dist/workspace/WorkspaceError.js +10 -3
  117. package/dist/workspace/WorkspaceError.js.map +1 -1
  118. package/dist/workspace/WorkspaceFindAndReadOptions.d.ts +6 -0
  119. package/dist/workspace/WorkspaceFindAndReadOptions.js +5 -0
  120. package/dist/workspace/WorkspaceFindAndReadOptions.js.map +1 -0
  121. package/dist/workspace/WorkspaceOptions.d.ts +4 -4
  122. package/dist/workspace/WorkspaceOptions.js.map +1 -1
  123. package/dist/workspace/{WorkspaceOptionsProjectOptions.d.ts → WorkspaceOptionsProject.d.ts} +4 -1
  124. package/dist/workspace/WorkspaceOptionsProject.js +3 -0
  125. package/dist/workspace/WorkspaceOptionsProject.js.map +1 -0
  126. package/dist/workspace/WorkspacePackageJson.d.ts +3 -0
  127. package/dist/workspace/WorkspacePackageJson.js.map +1 -1
  128. package/dist/workspace/WorkspaceProjectGlobs.d.ts +3 -0
  129. package/dist/workspace/WorkspaceProjectGlobs.js +3 -1
  130. package/dist/workspace/WorkspaceProjectGlobs.js.map +1 -1
  131. package/dist/workspace/WorkspaceProjects.d.ts +3 -0
  132. package/dist/workspace/WorkspaceProjects.js.map +1 -1
  133. package/dist/workspace/WorkspaceRepository.d.ts +4 -1
  134. package/dist/workspace/WorkspaceRepository.js +3 -1
  135. package/dist/workspace/WorkspaceRepository.js.map +1 -1
  136. package/dist/workspace/WorkspaceUpdateOptions.d.ts +3 -0
  137. package/dist/workspace/WorkspaceUpdateOptions.js +3 -1
  138. package/dist/workspace/WorkspaceUpdateOptions.js.map +1 -1
  139. package/dist/workspace/internals/compareProjectPath.d.ts +2 -0
  140. package/dist/workspace/internals/compareProjectPath.js +10 -0
  141. package/dist/workspace/internals/compareProjectPath.js.map +1 -0
  142. package/dist/workspace/internals/compareWorkspaceDependencyProjectName.d.ts +2 -0
  143. package/dist/workspace/internals/compareWorkspaceDependencyProjectName.js +10 -0
  144. package/dist/workspace/internals/compareWorkspaceDependencyProjectName.js.map +1 -0
  145. package/dist/workspace/internals/getRepositoryBranches.js +6 -0
  146. package/dist/workspace/internals/getRepositoryBranches.js.map +1 -1
  147. package/dist/workspace/internals/getRepositoryUrl.js +0 -1
  148. package/dist/workspace/internals/getRepositoryUrl.js.map +1 -1
  149. package/dist/workspace/internals.d.ts +2 -0
  150. package/dist/workspace/internals.js +2 -0
  151. package/dist/workspace/internals.js.map +1 -1
  152. package/dist/workspace/saveProjectConfig.d.ts +8 -0
  153. package/dist/workspace/saveProjectConfig.js +5 -1
  154. package/dist/workspace/saveProjectConfig.js.map +1 -1
  155. package/dist/workspace/saveWorkspaceConfig.d.ts +8 -0
  156. package/dist/workspace/saveWorkspaceConfig.js +5 -1
  157. package/dist/workspace/saveWorkspaceConfig.js.map +1 -1
  158. package/dist/workspace.d.ts +12 -0
  159. package/dist/workspace.js +12 -0
  160. package/dist/workspace.js.map +1 -1
  161. package/package.json +10 -10
  162. package/src/commands/create-project/CreateProject.tsx +2 -2
  163. package/src/commands/create-project/CreateProjectInput.ts +1 -1
  164. package/src/commands/create-project/createProjectCommand.tsx +1 -5
  165. package/src/commands/create-project/runCreateProject.ts +4 -17
  166. package/src/commands/create-workspace/CreateWorkspace.tsx +8 -6
  167. package/src/commands/create-workspace/createWorkspaceCommand.tsx +1 -14
  168. package/src/commands/create-workspace/runCreateWorkspace.ts +4 -16
  169. package/src/commands/internals/CommandStatus.ts +1 -0
  170. package/src/commands/internals.ts +1 -0
  171. package/src/commands/update-workspace/UpdateWorkspace.tsx +1 -1
  172. package/src/commands/update-workspace/updateWorkspaceCommand.tsx +1 -5
  173. package/src/template/CarsonTemplate.ts +1 -2
  174. package/src/template/CarsonTemplateConfig.ts +1 -1
  175. package/src/template/CarsonTemplateError.ts +19 -0
  176. package/src/template/TemplateAttributes.ts +2 -1
  177. package/src/template/TemplateRender.ts +6 -2
  178. package/src/template/TemplateRenders.ts +1 -1
  179. package/src/template/applyTemplateRenders.ts +40 -4
  180. package/src/template/internals/TemplateRenderSnapshot.ts +5 -0
  181. package/src/template/internals/deleteUsingTemplateRender.ts +21 -2
  182. package/src/template/internals/insertUsingTemplateRender.ts +11 -1
  183. package/src/template/internals/mergeUsingTemplateRender.ts +11 -1
  184. package/src/template/internals/parseCarsonTemplateId.ts +5 -1
  185. package/src/template/internals/readCarsonTemplate.ts +4 -1
  186. package/src/template/internals/saveTemplateRenderSnapshots.ts +3 -2
  187. package/src/template/internals/uninsertUsingTemplateRender.ts +11 -1
  188. package/src/template/internals/unmerge.ts +1 -1
  189. package/src/template/internals/unmergeUsingTemplateRender.ts +11 -1
  190. package/src/template/renderCarsonTemplate.ts +28 -7
  191. package/src/template.ts +1 -0
  192. package/src/workspace/Project.ts +16 -4
  193. package/src/workspace/ProjectConfig.ts +3 -0
  194. package/src/workspace/ProjectCreateOptions.ts +3 -0
  195. package/src/workspace/ProjectError.ts +5 -0
  196. package/src/workspace/ProjectOptions.ts +1 -1
  197. package/src/workspace/ProjectUpdateOptions.ts +3 -0
  198. package/src/workspace/Workspace.ts +125 -42
  199. package/src/workspace/WorkspaceConfig.ts +3 -0
  200. package/src/workspace/WorkspaceCreateOptions.ts +3 -0
  201. package/src/workspace/WorkspaceCreateProjectOptions.ts +3 -0
  202. package/src/workspace/WorkspaceDependencies.ts +30 -27
  203. package/src/workspace/WorkspaceDependenciesFromWorkspaceOptions.ts +8 -0
  204. package/src/workspace/WorkspaceDependenciesGetVersionsOptions.ts +6 -0
  205. package/src/workspace/WorkspaceDependency.ts +18 -0
  206. package/src/workspace/WorkspaceDependencyProject.ts +13 -0
  207. package/src/workspace/WorkspaceError.ts +10 -1
  208. package/src/workspace/WorkspaceFindAndReadOptions.ts +6 -0
  209. package/src/workspace/WorkspaceOptions.ts +4 -4
  210. package/src/workspace/{WorkspaceOptionsProjectOptions.ts → WorkspaceOptionsProject.ts} +4 -1
  211. package/src/workspace/WorkspacePackageJson.ts +3 -0
  212. package/src/workspace/WorkspaceProjectGlobs.ts +3 -0
  213. package/src/workspace/WorkspaceProjects.ts +3 -0
  214. package/src/workspace/WorkspaceRepository.ts +4 -1
  215. package/src/workspace/WorkspaceUpdateOptions.ts +3 -0
  216. package/src/workspace/internals/compareProjectPath.ts +14 -0
  217. package/src/workspace/internals/compareWorkspaceDependencyProjectName.ts +14 -0
  218. package/src/workspace/internals/getRepositoryBranches.ts +8 -0
  219. package/src/workspace/internals/getRepositoryUrl.ts +0 -1
  220. package/src/workspace/internals.ts +2 -0
  221. package/src/workspace/saveProjectConfig.ts +8 -0
  222. package/src/workspace/saveWorkspaceConfig.ts +8 -0
  223. package/src/workspace.ts +12 -0
  224. package/dist/workspace/WorkspaceOptionsProjectOptions.js +0 -3
  225. package/dist/workspace/WorkspaceOptionsProjectOptions.js.map +0 -1
package/dist/workspace.js CHANGED
@@ -1,12 +1,24 @@
1
1
  export * from './workspace/Project.js';
2
2
  export * from './workspace/ProjectConfig.js';
3
+ export * from './workspace/ProjectCreateOptions.js';
3
4
  export * from './workspace/ProjectError.js';
5
+ export * from './workspace/ProjectOptions.js';
6
+ export * from './workspace/ProjectUpdateOptions.js';
4
7
  export * from './workspace/saveProjectConfig.js';
5
8
  export * from './workspace/saveWorkspaceConfig.js';
6
9
  export * from './workspace/Workspace.js';
7
10
  export * from './workspace/WorkspaceConfig.js';
11
+ export * from './workspace/WorkspaceCreateOptions.js';
12
+ export * from './workspace/WorkspaceCreateProjectOptions.js';
8
13
  export * from './workspace/WorkspaceDependencies.js';
9
14
  export * from './workspace/WorkspaceError.js';
15
+ export * from './workspace/WorkspaceFindAndReadOptions.js';
16
+ export * from './workspace/WorkspaceOptions.js';
17
+ export * from './workspace/WorkspaceOptionsProject.js';
18
+ export * from './workspace/WorkspacePackageJson.js';
19
+ export * from './workspace/WorkspaceProjectGlobs.js';
20
+ export * from './workspace/WorkspaceProjects.js';
10
21
  export * from './workspace/WorkspaceRepository.js';
22
+ export * from './workspace/WorkspaceUpdateOptions.js';
11
23
 
12
24
  //# sourceMappingURL=workspace.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/workspace.ts"],"sourcesContent":["export * from './workspace/Project.js';\nexport * from './workspace/ProjectConfig.js';\nexport * from './workspace/ProjectError.js';\nexport * from './workspace/saveProjectConfig.js';\nexport * from './workspace/saveWorkspaceConfig.js';\nexport * from './workspace/Workspace.js';\nexport * from './workspace/WorkspaceConfig.js';\nexport * from './workspace/WorkspaceDependencies.js';\nexport * from './workspace/WorkspaceError.js';\nexport * from './workspace/WorkspaceRepository.js';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,mCAAmC;AACjD,cAAc,qCAAqC;AACnD,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC"}
1
+ {"version":3,"sources":["../src/workspace.ts"],"sourcesContent":["export * from './workspace/Project.js';\nexport * from './workspace/ProjectConfig.js';\nexport * from './workspace/ProjectCreateOptions.js';\nexport * from './workspace/ProjectError.js';\nexport * from './workspace/ProjectOptions.js';\nexport * from './workspace/ProjectUpdateOptions.js';\nexport * from './workspace/saveProjectConfig.js';\nexport * from './workspace/saveWorkspaceConfig.js';\nexport * from './workspace/Workspace.js';\nexport * from './workspace/WorkspaceConfig.js';\nexport * from './workspace/WorkspaceCreateOptions.js';\nexport * from './workspace/WorkspaceCreateProjectOptions.js';\nexport * from './workspace/WorkspaceDependencies.js';\nexport * from './workspace/WorkspaceError.js';\nexport * from './workspace/WorkspaceFindAndReadOptions.js';\nexport * from './workspace/WorkspaceOptions.js';\nexport * from './workspace/WorkspaceOptionsProject.js';\nexport * from './workspace/WorkspacePackageJson.js';\nexport * from './workspace/WorkspaceProjectGlobs.js';\nexport * from './workspace/WorkspaceProjects.js';\nexport * from './workspace/WorkspaceRepository.js';\nexport * from './workspace/WorkspaceUpdateOptions.js';\n"],"names":[],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,sCAAsC;AACpD,cAAc,8BAA8B;AAC5C,cAAc,gCAAgC;AAC9C,cAAc,sCAAsC;AACpD,cAAc,mCAAmC;AACjD,cAAc,qCAAqC;AACnD,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,wCAAwC;AACtD,cAAc,+CAA+C;AAC7D,cAAc,uCAAuC;AACrD,cAAc,gCAAgC;AAC9C,cAAc,6CAA6C;AAC3D,cAAc,kCAAkC;AAChD,cAAc,yCAAyC;AACvD,cAAc,sCAAsC;AACpD,cAAc,uCAAuC;AACrD,cAAc,mCAAmC;AACjD,cAAc,qCAAqC;AACnD,cAAc,wCAAwC"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@jakubmazanec/carson",
3
- "version": "0.1.0-c5ebb6f",
3
+ "version": "0.1.0-next.336fe21",
4
4
  "description": "Tool for managing workspace and project configuration.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "https://github.com/jakubmazanec/js-tools",
7
+ "url": "git@github.com:jakubmazanec/js-tools.git",
8
8
  "directory": "packages/carson"
9
9
  },
10
10
  "license": "AGPL-3.0-only",
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "scripts": {
23
23
  "build": "swc src -d dist && tsc",
24
- "clean": "del-cli dist *.tsbuildinfo",
24
+ "clean": "del-cli coverage dist *.tsbuildinfo",
25
25
  "develop": "swc src -d dist --watch",
26
26
  "document": "typedoc --options typedoc.config.cjs",
27
27
  "format": "prettier . --write --ignore-unknown --ignore-path ../../.prettierignore",
@@ -31,13 +31,13 @@
31
31
  "typecheck": "tsc --project tsconfig.typecheck.json"
32
32
  },
33
33
  "dependencies": {
34
- "@jakubmazanec/args": "1.0.1-c5ebb6f",
35
- "@jakubmazanec/cli": "0.1.0-c5ebb6f",
36
- "@jakubmazanec/error": "2.0.1-c5ebb6f",
37
- "@jakubmazanec/fs-utils": "0.1.0-c5ebb6f",
38
- "@jakubmazanec/template": "1.0.1-c5ebb6f",
39
- "@jakubmazanec/ts-utils": "2.1.0-c5ebb6f",
40
- "@jakubmazanec/zod-utils": "1.0.0-c5ebb6f",
34
+ "@jakubmazanec/args": "1.0.1-next.336fe21",
35
+ "@jakubmazanec/cli": "0.1.0-next.336fe21",
36
+ "@jakubmazanec/error": "2.0.1-next.336fe21",
37
+ "@jakubmazanec/fs-utils": "0.1.0-next.336fe21",
38
+ "@jakubmazanec/template": "1.0.1-next.336fe21",
39
+ "@jakubmazanec/ts-utils": "2.1.0-next.336fe21",
40
+ "@jakubmazanec/zod-utils": "1.0.0-next.336fe21",
41
41
  "chalk": "^5.2.0",
42
42
  "diff": "^5.1.0",
43
43
  "fast-glob": "^3.2.11",
@@ -8,7 +8,7 @@ import {type createProjectCommand} from './createProjectCommand.js';
8
8
  import {CreateProjectInput, type CreateProjectInputResult} from './CreateProjectInput.js';
9
9
  import {runCreateProject} from './runCreateProject.js';
10
10
  import {type Workspace} from '../../workspace.js';
11
- import {packageNameToDirectory} from '../internals.js';
11
+ import {packageNameToDirectory, type CommandStatus} from '../internals.js';
12
12
 
13
13
  const ONLY_ONE_STAR_REGEXP = /^(?!(.*?\*){2,}|.*? |\*$).*?\*.*$/;
14
14
 
@@ -18,7 +18,7 @@ export type CreateProjectProps = {
18
18
  };
19
19
 
20
20
  export function CreateProject({args, workspace}: CreateProjectProps) {
21
- let [status, setStatus] = useState<'finished' | 'in-progress' | 'not-started'>('not-started');
21
+ let [status, setStatus] = useState<CommandStatus>('not-started');
22
22
  let [subscription, setSubscription] = useState<ZenObservable.Subscription | null>(null);
23
23
  let [jobs, setJobs] = useState<string[]>([]);
24
24
  let [createProjectInputResult, setCreateProjectInputResult] = useState<CreateProjectInputResult>(
@@ -22,7 +22,7 @@ export const CreateProjectInput = createForm({
22
22
  validate: (value: string) => {
23
23
  if (!PROJECT_NAME_ID_REGEXP.test(value)) {
24
24
  throw new Error(
25
- 'Project name can containg only lowercase letters, numbers, hyphen, @, dot or /.',
25
+ 'Project name can contain only lowercase letters, numbers, hyphen, @, dot or /.',
26
26
  );
27
27
  }
28
28
  },
@@ -8,11 +8,7 @@ export const createProjectCommand = new Command(
8
8
  'create project',
9
9
  async (args, program) => {
10
10
  let targetPath = path.resolve(process.cwd(), args.options.path ?? '');
11
- let workspace = await Workspace.findAndRead(targetPath);
12
-
13
- if (!workspace) {
14
- throw new Error(`No workspace found at "${targetPath}"!`);
15
- }
11
+ let workspace = await Workspace.findAndRead(targetPath, {throwIfNotFound: true});
16
12
 
17
13
  await program.renderElement(<CreateProject args={args} workspace={workspace} />);
18
14
  },
@@ -1,7 +1,4 @@
1
1
  import {type CommandArguments} from '@jakubmazanec/cli';
2
- import {isEmptyDirectory} from '@jakubmazanec/fs-utils';
3
- import fs from 'fs-extra';
4
- import path from 'node:path';
5
2
  import Observable from 'zen-observable';
6
3
 
7
4
  import {type createProjectCommand} from './createProjectCommand.js';
@@ -26,27 +23,17 @@ export function runCreateProject({
26
23
  }: CreateProjectOptions) {
27
24
  return new Observable<CreateProjectStatus>((observer) => {
28
25
  (async () => {
29
- observer.next('TODO');
26
+ observer.next('Creating files');
30
27
 
31
- let resolvedProjectPath = path.resolve(projectPath);
32
-
33
- // check if path is ok
34
- await fs.ensureDir(resolvedProjectPath);
35
-
36
- let isProjectPathEmpty = await isEmptyDirectory(resolvedProjectPath);
37
-
38
- if (!isProjectPathEmpty) {
39
- throw new Error(`Directory "${resolvedProjectPath}" must be empty`);
40
- }
41
-
42
- // create new project
43
28
  let project = await workspace.createProject({
44
- projectPath: resolvedProjectPath,
29
+ projectPath,
45
30
  projectName,
46
31
  templateId,
47
32
  args,
48
33
  });
49
34
 
35
+ observer.next('Updating the new project');
36
+
50
37
  await project.update({args});
51
38
  })()
52
39
  .then(() => {
@@ -1,19 +1,20 @@
1
1
  import {Header, icons, colors, type CommandArguments, useProgram} from '@jakubmazanec/cli';
2
2
  import chalk from 'chalk';
3
3
  import {Box, Text} from 'ink';
4
+ import path from 'node:path';
4
5
  import {useEffect, useState} from 'react';
5
6
 
6
7
  import {type createWorkspaceCommand} from './createWorkspaceCommand.js';
7
8
  import {CreateWorkspaceInput, type CreateWorkspaceInputResult} from './CreateWorkspaceInput.js';
8
9
  import {runCreateWorkspace} from './runCreateWorkspace.js';
10
+ import {type CommandStatus} from '../internals.js';
9
11
 
10
12
  export type CreateWorkspaceProps = {
11
13
  args: CommandArguments<typeof createWorkspaceCommand>;
12
- path: string;
13
14
  };
14
15
 
15
- export function CreateWorkspace({args, path}: CreateWorkspaceProps) {
16
- let [status, setStatus] = useState<'finished' | 'in-progress' | 'not-started'>('not-started');
16
+ export function CreateWorkspace({args}: CreateWorkspaceProps) {
17
+ let [status, setStatus] = useState<CommandStatus>('not-started');
17
18
  let [subscription, setSubscription] = useState<ZenObservable.Subscription | null>(null);
18
19
  let [jobs, setJobs] = useState<string[]>([]);
19
20
  let [createWorkspaceInputResult, setCreateWorkspaceInputResult] =
@@ -21,6 +22,7 @@ export function CreateWorkspace({args, path}: CreateWorkspaceProps) {
21
22
  templateId: {value: args.options.template ?? '', isComplete: !!args.options.template},
22
23
  }));
23
24
  let {exit} = useProgram();
25
+ let workspacePath = path.resolve(process.cwd(), args.options.path ?? '');
24
26
 
25
27
  useEffect(() => {
26
28
  if (Object.entries(createWorkspaceInputResult).every(([, result]) => result.isComplete)) {
@@ -31,7 +33,7 @@ export function CreateWorkspace({args, path}: CreateWorkspaceProps) {
31
33
  useEffect(() => {
32
34
  if (status === 'in-progress' && !subscription) {
33
35
  let newSubscription = runCreateWorkspace({
34
- workspacePath: path,
36
+ workspacePath,
35
37
  templateId: createWorkspaceInputResult.templateId.value,
36
38
  args,
37
39
  }).subscribe({
@@ -55,11 +57,11 @@ export function CreateWorkspace({args, path}: CreateWorkspaceProps) {
55
57
  subscription.unsubscribe();
56
58
  }
57
59
  };
58
- }, [createWorkspaceInputResult, path, status, subscription, args, exit]);
60
+ }, [createWorkspaceInputResult, status, subscription, args, exit, workspacePath]);
59
61
 
60
62
  return (
61
63
  <Box flexDirection="column">
62
- <Text>{`Creating workspace at ${chalk[colors.highlighted](path)}.`}</Text>
64
+ <Text>{`Creating workspace at ${chalk[colors.info](workspacePath)}.`}</Text>
63
65
 
64
66
  <CreateWorkspaceInput
65
67
  values={createWorkspaceInputResult}
@@ -1,24 +1,11 @@
1
1
  import {Command} from '@jakubmazanec/cli';
2
- import {isEmptyDirectory} from '@jakubmazanec/fs-utils';
3
- import fs from 'fs-extra';
4
- import path from 'node:path';
5
2
 
6
3
  import {CreateWorkspace} from './CreateWorkspace.js';
7
4
 
8
5
  export const createWorkspaceCommand = new Command(
9
6
  'create workspace',
10
7
  async (args, program) => {
11
- let workspacePath = path.resolve(process.cwd(), args.options.path ?? '');
12
-
13
- await fs.ensureDir(workspacePath);
14
-
15
- let isWorkspacePathEmpty = await isEmptyDirectory(workspacePath);
16
-
17
- if (!isWorkspacePathEmpty) {
18
- throw new Error(`Directory "${workspacePath}" must be empty`);
19
- }
20
-
21
- await program.renderElement(<CreateWorkspace args={args} path={workspacePath} />);
8
+ await program.renderElement(<CreateWorkspace args={args} />);
22
9
  },
23
10
  {
24
11
  description: 'Creates a new workspacee.',
@@ -1,7 +1,4 @@
1
1
  import {type CommandArguments} from '@jakubmazanec/cli';
2
- import {isEmptyDirectory} from '@jakubmazanec/fs-utils';
3
- import fs from 'fs-extra';
4
- import path from 'node:path';
5
2
  import Observable from 'zen-observable';
6
3
 
7
4
  import {type createWorkspaceCommand} from './createWorkspaceCommand.js';
@@ -18,25 +15,16 @@ export type CreateWorkspaceStatus = string;
18
15
  export function runCreateWorkspace({workspacePath, templateId, args}: CreateWorkspaceOptions) {
19
16
  return new Observable<CreateWorkspaceStatus>((observer) => {
20
17
  (async () => {
21
- observer.next('TODO');
18
+ observer.next('Creating files');
22
19
 
23
- let resolvedWorkspacePath = path.resolve(workspacePath);
24
-
25
- await fs.ensureDir(resolvedWorkspacePath);
26
-
27
- let isWorkspacePathEmpty = await isEmptyDirectory(resolvedWorkspacePath);
28
-
29
- if (!isWorkspacePathEmpty) {
30
- throw new Error(`Directory "${resolvedWorkspacePath}" must be empty`);
31
- }
32
-
33
- // create new workspace
34
20
  let workspace = await Workspace.create({
35
21
  args,
36
- path: resolvedWorkspacePath,
22
+ path: workspacePath,
37
23
  templateId,
38
24
  });
39
25
 
26
+ observer.next('Updating the new workspace');
27
+
40
28
  await workspace.update({args});
41
29
  })()
42
30
  .then(() => {
@@ -0,0 +1 @@
1
+ export type CommandStatus = 'finished' | 'in-progress' | 'not-started';
@@ -1 +1,2 @@
1
+ export * from './internals/CommandStatus.js';
1
2
  export * from './internals/packageNameToDirectory.js';
@@ -41,7 +41,7 @@ export function UpdateWorkspace({workspace, args}: UpdateWorkspaceProps) {
41
41
 
42
42
  <Box marginTop={1} flexDirection="column">
43
43
  <Header showSpinner={!isFinished} icon={icons.success} marginBottom={1}>
44
- <Text>Updating workspace...</Text>
44
+ <Text>Updating workspace and projects...</Text>
45
45
  </Header>
46
46
 
47
47
  {jobs.map((job) => (
@@ -8,11 +8,7 @@ export const updateWorkspaceCommand = new Command(
8
8
  'update workspace',
9
9
  async (args, program) => {
10
10
  let resolvedPath = path.resolve(process.cwd(), args.options.path ?? '');
11
- let workspace = await Workspace.findAndRead(resolvedPath);
12
-
13
- if (!workspace) {
14
- throw new Error(`No workspace found at "${resolvedPath}"!`);
15
- }
11
+ let workspace = await Workspace.findAndRead(resolvedPath, {throwIfNotFound: true});
16
12
 
17
13
  await program.renderElement(<UpdateWorkspace workspace={workspace} args={args} />);
18
14
  },
@@ -9,12 +9,11 @@ import {type templateDataSchema} from './TemplateData.js';
9
9
  */
10
10
  export type CarsonTemplate = {
11
11
  /** Carson template name. */
12
-
13
12
  name: string;
14
13
 
15
14
  /** Carson template config. */
16
15
  config: CarsonTemplateConfig;
17
16
 
18
- /** Carson template files, actually instances of {@linkcode Template}. */
17
+ /** Carson template files, actually instances of {@link Template}. */
19
18
  files: Array<Template<typeof templateAttributesSchema, typeof templateDataSchema>>;
20
19
  };
@@ -10,6 +10,6 @@ export const carsonTemplateConfigSchema = z
10
10
  .strict();
11
11
 
12
12
  /**
13
- * Carson teamplate config.
13
+ * Carson template config.
14
14
  */
15
15
  export type CarsonTemplateConfig = z.infer<typeof carsonTemplateConfigSchema>;
@@ -0,0 +1,19 @@
1
+ import {createCustomErrorWithData} from '@jakubmazanec/error';
2
+
3
+ /**
4
+ * A subclass of `Error` that indicates a Carson template failure.
5
+ */
6
+ export const CarsonTemplateError = createCustomErrorWithData(
7
+ 'CarsonTemplateError',
8
+ {
9
+ INVALID_CARSON_TEMPLATE_ID:
10
+ 'Invalid Carson template ID "{0}". Carson template ID must consist of a module ID and a template name separated by a colon.',
11
+ CARSON_TEMPLATE_NOT_FOUND: 'Carson template "{0}" was not found in module "{1}".',
12
+ STRATEGY_UNSUPPORTED_EXTENSION:
13
+ 'Strategy "{0}" in the template file "{1}" doesn\'t support extension "{2}".',
14
+ STRATEGY_MISSING_FILE: 'Strategy "{0}" in the template file "{1}" is missing file "{2}".',
15
+ },
16
+ class CarsonTemplateErrorData {
17
+ path?: string;
18
+ },
19
+ );
@@ -1,7 +1,9 @@
1
1
  import {z} from 'zod';
2
2
 
3
+ // TODO: add strategy 'none' so when you using template A that extends template B, you can overwrite template files to no-op
3
4
  let strategyTemplateAttributeSchema = z.union([
4
5
  z.literal('create'),
6
+ z.literal('ensure'),
5
7
  z.literal('overwrite'),
6
8
  z.literal('merge'),
7
9
  z.literal('check'),
@@ -10,7 +12,6 @@ let strategyTemplateAttributeSchema = z.union([
10
12
 
11
13
  export const templateAttributesSchema = z
12
14
  .object({
13
- // TODO: add strategy 'none' so when you using template A that extends template B, you can overwrite template files to no-op
14
15
  strategy: strategyTemplateAttributeSchema,
15
16
  })
16
17
  .strict();
@@ -4,9 +4,13 @@ import {type templateAttributesSchema} from './TemplateAttributes.js';
4
4
  import {type templateDataSchema} from './TemplateData.js';
5
5
 
6
6
  /**
7
- * A template render result.
7
+ * A result of rendering a Carson template file.
8
8
  */
9
9
  export type TemplateRender = BaseTemplateRender<
10
10
  typeof templateAttributesSchema,
11
11
  typeof templateDataSchema
12
- >;
12
+ > & {
13
+ template: {
14
+ path: string;
15
+ };
16
+ };
@@ -1,6 +1,6 @@
1
1
  import {type TemplateRender} from './TemplateRender.js';
2
2
 
3
3
  /**
4
- * A collection of template render results.
4
+ * A {@link TemplateRender} collection.
5
5
  */
6
6
  export type TemplateRenders = TemplateRender[];
@@ -1,7 +1,10 @@
1
+ // TODO: can this be fixed?
2
+ /* eslint-disable complexity -- TODO */
1
3
  import fs from 'fs-extra';
2
4
  import path from 'node:path';
3
5
  import prettier from 'prettier';
4
6
 
7
+ import {CarsonTemplateError} from './CarsonTemplateError.js';
5
8
  import {
6
9
  createUsingTemplateRender,
7
10
  deleteUsingTemplateRender,
@@ -22,6 +25,9 @@ export type ApplyTemplateRendersOptions = {
22
25
  ignoreStrategies: string[];
23
26
  };
24
27
 
28
+ /**
29
+ * Applies rendered Carson template to a specified path, i.e. creates and updates files based on the result of rendering each Carson template file.
30
+ */
25
31
  export async function applyTemplateRenders({
26
32
  templateRenders,
27
33
  path: targetPath,
@@ -30,6 +36,7 @@ export async function applyTemplateRenders({
30
36
  // we need to clear Prettier cache, because we are changing file system
31
37
  prettier.clearConfigCache();
32
38
 
39
+ // first, we read the existing snapshots and use them to undo previous changes
33
40
  let templateRenderSnapshotsPath = path.join(
34
41
  targetPath,
35
42
  CARSON_CONFIG_DIRECTORY,
@@ -49,6 +56,12 @@ export async function applyTemplateRenders({
49
56
  continue;
50
57
  }
51
58
 
59
+ if (templateRenderSnapshot.attributes.strategy === 'ensure') {
60
+ await deleteUsingTemplateRender(templateRenderSnapshot, targetPath, {
61
+ onlyDeleteWhenContentsMatch: true,
62
+ });
63
+ }
64
+
52
65
  if (templateRenderSnapshot.attributes.strategy === 'overwrite') {
53
66
  await deleteUsingTemplateRender(templateRenderSnapshot, targetPath);
54
67
  }
@@ -63,14 +76,32 @@ export async function applyTemplateRenders({
63
76
  }
64
77
  }
65
78
 
66
- if (!ignoreStrategies.includes('create')) {
67
- for (let templateRender of templateRenders) {
68
- if (templateRender.attributes.strategy === 'create') {
79
+ // second, we apply strategies that create files
80
+ for (let templateRender of templateRenders) {
81
+ let strategy =
82
+ typeof templateRender.attributes.strategy === 'string'
83
+ ? templateRender.attributes.strategy
84
+ : templateRender.attributes.strategy[0];
85
+
86
+ if (ignoreStrategies.includes(strategy)) {
87
+ continue;
88
+ }
89
+
90
+ if (templateRender.attributes.strategy === 'create') {
91
+ await createUsingTemplateRender(templateRender, targetPath);
92
+ }
93
+
94
+ if (templateRender.attributes.strategy === 'ensure') {
95
+ let to = path.join(targetPath, templateRender.attributes.to);
96
+ let doesToExist = await fs.pathExists(to);
97
+
98
+ if (!doesToExist) {
69
99
  await createUsingTemplateRender(templateRender, targetPath);
70
100
  }
71
101
  }
72
102
  }
73
103
 
104
+ // third, we apply strategies that change files
74
105
  for (let templateRender of templateRenders) {
75
106
  let strategy =
76
107
  typeof templateRender.attributes.strategy === 'string'
@@ -98,7 +129,12 @@ export async function applyTemplateRenders({
98
129
  let doesToExist = await fs.pathExists(to);
99
130
 
100
131
  if (!doesToExist) {
101
- throw new Error(`File "${to}" doesn't exist!`);
132
+ throw new CarsonTemplateError('STRATEGY_MISSING_FILE', {
133
+ messageParameters: [templateRender.attributes.strategy, templateRender.template.path, to],
134
+ data: {
135
+ path: to,
136
+ },
137
+ });
102
138
  }
103
139
  }
104
140
  }
@@ -7,6 +7,11 @@ export const templateRenderSnapshotSchema = z
7
7
  .object({
8
8
  attributes: baseTemplateAttributesSchema.pick({to: true}).merge(templateAttributesSchema),
9
9
  content: z.string(),
10
+ template: z
11
+ .object({
12
+ path: z.string(),
13
+ })
14
+ .strict(),
10
15
  })
11
16
  .strict();
12
17
 
@@ -1,16 +1,35 @@
1
1
  import fs from 'fs-extra';
2
2
  import path from 'node:path';
3
3
 
4
+ import {prettify} from './prettify.js';
4
5
  import {type TemplateRenderSnapshot} from './TemplateRenderSnapshot.js';
5
6
  import {type TemplateRender} from '../TemplateRender.js';
6
7
 
8
+ export type DeleteUsingTemplateRenderOptions = {
9
+ onlyDeleteWhenContentsMatch?: boolean;
10
+ };
11
+
7
12
  export async function deleteUsingTemplateRender(
8
13
  templateRender: TemplateRender | TemplateRenderSnapshot,
9
14
  basePath: string,
15
+ options?: DeleteUsingTemplateRenderOptions,
10
16
  ) {
11
17
  let to = path.join(basePath, templateRender.attributes.to);
12
18
 
13
- if (await fs.pathExists(to)) {
14
- await fs.rm(to);
19
+ if (!(await fs.pathExists(to))) {
20
+ return;
21
+ }
22
+
23
+ if (options?.onlyDeleteWhenContentsMatch) {
24
+ let existingContent = await fs.readFile(to, {encoding: 'utf8'});
25
+ let newContent = await prettify(templateRender.content, to);
26
+
27
+ if (existingContent.trim() === newContent.trim()) {
28
+ await fs.rm(to);
29
+ }
30
+
31
+ return;
15
32
  }
33
+
34
+ await fs.rm(to);
16
35
  }
@@ -4,6 +4,7 @@ import path from 'node:path';
4
4
 
5
5
  import {prettify} from './prettify.js';
6
6
  import {type TemplateRenderSnapshot} from './TemplateRenderSnapshot.js';
7
+ import {CarsonTemplateError} from '../CarsonTemplateError.js';
7
8
  import {type TemplateRender} from '../TemplateRender.js';
8
9
 
9
10
  export async function insertUsingTemplateRender(
@@ -33,7 +34,16 @@ export async function insertUsingTemplateRender(
33
34
  }
34
35
 
35
36
  default: {
36
- throw new Error(`File extension "${extension}" is not supported!`);
37
+ throw new CarsonTemplateError('STRATEGY_UNSUPPORTED_EXTENSION', {
38
+ messageParameters: [
39
+ templateRender.attributes.strategy,
40
+ templateRender.template.path,
41
+ extension,
42
+ ],
43
+ data: {
44
+ path: templateRender.template.path,
45
+ },
46
+ });
37
47
  }
38
48
  }
39
49
  }
@@ -7,6 +7,7 @@ import yaml from 'yaml';
7
7
  import {merge} from './merge.js';
8
8
  import {prettify} from './prettify.js';
9
9
  import {type TemplateRenderSnapshot} from './TemplateRenderSnapshot.js';
10
+ import {CarsonTemplateError} from '../CarsonTemplateError.js';
10
11
  import {type TemplateRender} from '../TemplateRender.js';
11
12
 
12
13
  export async function mergeUsingTemplateRender(
@@ -38,7 +39,16 @@ export async function mergeUsingTemplateRender(
38
39
  }
39
40
 
40
41
  default: {
41
- throw new Error(`File extension "${extension}" is not supported!`);
42
+ throw new CarsonTemplateError('STRATEGY_UNSUPPORTED_EXTENSION', {
43
+ messageParameters: [
44
+ templateRender.attributes.strategy,
45
+ templateRender.template.path,
46
+ extension,
47
+ ],
48
+ data: {
49
+ path: templateRender.template.path,
50
+ },
51
+ });
42
52
  }
43
53
  }
44
54
  }
@@ -1,8 +1,12 @@
1
+ import {CarsonTemplateError} from '../CarsonTemplateError.js';
2
+
1
3
  export function parseCarsonTemplateId(value: string): [moduleId: string, templateName: string] {
2
4
  let parts = value.split(':');
3
5
 
4
6
  if (!parts[0] || !parts[1]) {
5
- throw new Error('Template id is invalid!');
7
+ throw new CarsonTemplateError('INVALID_CARSON_TEMPLATE_ID', {
8
+ messageParameters: [value],
9
+ });
6
10
  }
7
11
 
8
12
  return [parts[0], parts[1]];
@@ -9,6 +9,7 @@ import {resolveModule} from './resolveModule.js';
9
9
  import {TEMPLATES_PATH, TEMPLATE_CONFIG_FILENAME} from '../../constants.js';
10
10
  import {type CarsonTemplate} from '../CarsonTemplate.js';
11
11
  import {carsonTemplateConfigSchema} from '../CarsonTemplateConfig.js';
12
+ import {CarsonTemplateError} from '../CarsonTemplateError.js';
12
13
  import {templateAttributesSchema} from '../TemplateAttributes.js';
13
14
 
14
15
  export async function readCarsonTemplate(templateId: string): Promise<CarsonTemplate> {
@@ -42,5 +43,7 @@ export async function readCarsonTemplate(templateId: string): Promise<CarsonTemp
42
43
  return carsonTemplate;
43
44
  }
44
45
 
45
- throw new Error(`Template ${templateId} was not found in module ${moduleId}!`);
46
+ throw new CarsonTemplateError('CARSON_TEMPLATE_NOT_FOUND', {
47
+ messageParameters: [templateId, moduleId],
48
+ });
46
49
  }
@@ -12,6 +12,7 @@ export async function saveTemplateRenderSnapshots(
12
12
 
13
13
  for (let templateRender of templateRenders) {
14
14
  if (
15
+ templateRender.attributes.strategy === 'ensure' ||
15
16
  templateRender.attributes.strategy === 'overwrite' ||
16
17
  templateRender.attributes.strategy === 'merge' ||
17
18
  templateRender.attributes.strategy[0] === 'insert'
@@ -22,13 +23,13 @@ export async function saveTemplateRenderSnapshots(
22
23
  strategy: templateRender.attributes.strategy,
23
24
  },
24
25
  content: templateRender.content,
26
+ template: templateRender.template,
25
27
  });
26
28
  }
27
29
  }
28
- let uncompressedSnapshots = JSON.stringify(templateRendersSnapshots);
29
30
 
30
31
  await fs.writeFile(
31
32
  templateRenderSnapshotsPath,
32
- deflateSync(strToU8(uncompressedSnapshots), {level: 1, mem: 0}),
33
+ deflateSync(strToU8(JSON.stringify(templateRendersSnapshots)), {level: 1, mem: 0}),
33
34
  );
34
35
  }