@jakubmazanec/carson 1.3.0-unstable.d6c542d → 1.3.0
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.
- package/build/commands/create-project/CreateProject.js +4 -4
- package/build/commands/create-project/CreateProject.js.map +2 -2
- package/build/commands/create-project/runCreateProject.js.map +2 -2
- package/build/commands/create-workspace/CreateWorkspace.js +4 -4
- package/build/commands/create-workspace/CreateWorkspace.js.map +2 -2
- package/build/commands/create-workspace/runCreateWorkspace.js.map +2 -2
- package/build/commands/internals.d.ts +1 -1
- package/build/commands/internals.js +0 -1
- package/build/commands/internals.js.map +2 -2
- package/build/commands/update-workspace/UpdateWorkspace.js +3 -3
- package/build/commands/update-workspace/UpdateWorkspace.js.map +2 -2
- package/build/commands/update-workspace/runUpdateWorkspace.js.map +2 -2
- package/build/commands/update-workspace/updateWorkspaceCommand.js +1 -1
- package/build/commands/update-workspace/updateWorkspaceCommand.js.map +2 -2
- package/build/template/CarsonTemplateError.d.ts +2 -2
- package/build/template/CarsonTemplateError.js +2 -1
- package/build/template/CarsonTemplateError.js.map +2 -2
- package/build/template/applyTemplateRenders.js +7 -7
- package/build/template/applyTemplateRenders.js.map +2 -2
- package/build/template/internals/TemplateRenderSnapshot.d.ts +3 -16
- package/build/template/internals/TemplateRenderSnapshot.js +1 -4
- package/build/template/internals/TemplateRenderSnapshot.js.map +2 -2
- package/build/template/internals/TemplateRenderSnapshots.d.ts +3 -16
- package/build/template/internals/createUsingTemplateRender.d.ts +1 -2
- package/build/template/internals/createUsingTemplateRender.js.map +2 -2
- package/build/template/internals/deleteUsingTemplateRenderSnapshot.d.ts +5 -0
- package/build/template/internals/deleteUsingTemplateRenderSnapshot.js +24 -0
- package/build/template/internals/deleteUsingTemplateRenderSnapshot.js.map +7 -0
- package/build/template/internals/insertUsingTemplateRender.d.ts +1 -2
- package/build/template/internals/insertUsingTemplateRender.js.map +2 -2
- package/build/template/internals/loadTemplateRenderSnapshots.d.ts +1 -4
- package/build/template/internals/mergeUsingTemplateRender.d.ts +1 -2
- package/build/template/internals/mergeUsingTemplateRender.js.map +2 -2
- package/build/template/internals/overwriteUsingTemplateRender.d.ts +1 -2
- package/build/template/internals/overwriteUsingTemplateRender.js.map +2 -2
- package/build/template/internals/saveTemplateRenderSnapshots.js +40 -3
- package/build/template/internals/saveTemplateRenderSnapshots.js.map +2 -2
- package/build/template/internals/simplify.d.ts +4 -0
- package/build/template/internals/simplify.js +20 -0
- package/build/template/internals/simplify.js.map +7 -0
- package/build/template/internals/uninsertUsingTemplateRenderSnapshot.d.ts +2 -0
- package/build/template/internals/{uninsertUsingTemplateRender.js → uninsertUsingTemplateRenderSnapshot.js} +7 -16
- package/build/template/internals/uninsertUsingTemplateRenderSnapshot.js.map +7 -0
- package/build/template/internals/unmergeUsingTemplateRenderSnapshot.d.ts +2 -0
- package/build/template/internals/{unmergeUsingTemplateRender.js → unmergeUsingTemplateRenderSnapshot.js} +9 -15
- package/build/template/internals/unmergeUsingTemplateRenderSnapshot.js.map +7 -0
- package/build/template/internals.d.ts +4 -3
- package/build/template/internals.js +4 -3
- package/build/template/internals.js.map +2 -2
- package/build/template.d.ts +3 -3
- package/build/template.js +0 -3
- package/build/template.js.map +2 -2
- package/build/workspace.d.ts +13 -13
- package/build/workspace.js +0 -13
- package/build/workspace.js.map +2 -2
- package/package.json +32 -32
- package/source/commands/create-project/CreateProject.tsx +4 -4
- package/source/commands/create-project/runCreateProject.ts +1 -1
- package/source/commands/create-workspace/CreateWorkspace.tsx +4 -4
- package/source/commands/create-workspace/runCreateWorkspace.ts +1 -1
- package/source/commands/internals.ts +1 -1
- package/source/commands/update-workspace/UpdateWorkspace.tsx +3 -3
- package/source/commands/update-workspace/runUpdateWorkspace.ts +1 -1
- package/source/commands/update-workspace/updateWorkspaceCommand.tsx +1 -1
- package/source/template/CarsonTemplateError.ts +1 -0
- package/source/template/applyTemplateRenders.ts +7 -7
- package/source/template/internals/TemplateRenderSnapshot.ts +1 -6
- package/source/template/internals/createUsingTemplateRender.ts +1 -5
- package/source/template/internals/{deleteUsingTemplateRender.ts → deleteUsingTemplateRenderSnapshot.ts} +9 -5
- package/source/template/internals/insertUsingTemplateRender.ts +1 -5
- package/source/template/internals/mergeUsingTemplateRender.ts +1 -5
- package/source/template/internals/overwriteUsingTemplateRender.ts +1 -2
- package/source/template/internals/saveTemplateRenderSnapshots.ts +49 -3
- package/source/template/internals/simplify.ts +30 -0
- package/source/template/internals/{uninsertUsingTemplateRender.ts → uninsertUsingTemplateRenderSnapshot.ts} +7 -17
- package/source/template/internals/{unmergeUsingTemplateRender.ts → unmergeUsingTemplateRenderSnapshot.ts} +10 -16
- package/source/template/internals.ts +4 -3
- package/source/template.ts +3 -3
- package/source/workspace.ts +13 -13
- package/build/template/internals/deleteUsingTemplateRender.d.ts +0 -6
- package/build/template/internals/deleteUsingTemplateRender.js +0 -20
- package/build/template/internals/deleteUsingTemplateRender.js.map +0 -7
- package/build/template/internals/uninsertUsingTemplateRender.d.ts +0 -3
- package/build/template/internals/uninsertUsingTemplateRender.js.map +0 -7
- package/build/template/internals/unmergeUsingTemplateRender.d.ts +0 -3
- package/build/template/internals/unmergeUsingTemplateRender.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../source/template/internals/insertUsingTemplateRender.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport _ from 'lodash';\nimport path from 'node:path';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {prettify} from './prettify.js';\
|
|
5
|
-
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,OAAO;AACd,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAElC,SAAQ,gBAAe;
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\nimport _ from 'lodash';\nimport path from 'node:path';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {prettify} from './prettify.js';\n\nexport async function insertUsingTemplateRender(templateRender: TemplateRender, basePath: string) {\n let to = path.join(basePath, templateRender.attributes.to);\n let extension = path.extname(to);\n\n switch (extension) {\n case '.md': {\n if (await fs.pathExists(to)) {\n let targetFile = await fs.readFile(to, {encoding: 'utf8'});\n let newContent = `<!-- ${templateRender.attributes.strategy[1]} -->${templateRender.content}<!-- ${templateRender.attributes.strategy[1]} -->`;\n let oldContentRegexp = new RegExp(\n `<!--\\\\s*${_.escapeRegExp(\n templateRender.attributes.strategy[1],\n )}\\\\s-->[\\\\s\\\\S]*<!--\\\\s*${_.escapeRegExp(templateRender.attributes.strategy[1])}\\\\s-->`,\n 'u',\n );\n let newFile = targetFile.replace(oldContentRegexp, newContent);\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n }\n\n break;\n }\n\n default: {\n throw new CarsonTemplateError('STRATEGY_UNSUPPORTED_EXTENSION', {\n messageParameters: [\n templateRender.attributes.strategy,\n templateRender.template.path,\n extension,\n ],\n data: {\n path: templateRender.template.path,\n },\n });\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,OAAO;AACd,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAElC,SAAQ,gBAAe;AAEvB,sBAAsB,0BAA0B,gBAAgC,UAAkB;AAChG,MAAI,KAAK,KAAK,KAAK,UAAU,eAAe,WAAW,EAAE;AACzD,MAAI,YAAY,KAAK,QAAQ,EAAE;AAE/B,UAAQ,WAAW;AAAA,IACjB,KAAK,OAAO;AACV,UAAI,MAAM,GAAG,WAAW,EAAE,GAAG;AAC3B,YAAI,aAAa,MAAM,GAAG,SAAS,IAAI,EAAC,UAAU,OAAM,CAAC;AACzD,YAAI,aAAa,QAAQ,eAAe,WAAW,SAAS,CAAC,CAAC,OAAO,eAAe,OAAO,QAAQ,eAAe,WAAW,SAAS,CAAC,CAAC;AACxI,YAAI,mBAAmB,IAAI;AAAA,UACzB,WAAW,EAAE;AAAA,YACX,eAAe,WAAW,SAAS,CAAC;AAAA,UACtC,CAAC,0BAA0B,EAAE,aAAa,eAAe,WAAW,SAAS,CAAC,CAAC,CAAC;AAAA,UAChF;AAAA,QACF;AACA,YAAI,UAAU,WAAW,QAAQ,kBAAkB,UAAU;AAE7D,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACxE;AAEA;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,IAAI,oBAAoB,kCAAkC;AAAA,QAC9D,mBAAmB;AAAA,UACjB,eAAe,WAAW;AAAA,UAC1B,eAAe,SAAS;AAAA,UACxB;AAAA,QACF;AAAA,QACA,MAAM;AAAA,UACJ,MAAM,eAAe,SAAS;AAAA,QAChC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
export declare function loadTemplateRenderSnapshots(templateRenderSnapshotsPath: string): Promise<{
|
|
2
|
-
template: {
|
|
3
|
-
path: string;
|
|
4
|
-
};
|
|
5
2
|
attributes: {
|
|
6
3
|
strategy: "create" | "ensure" | "overwrite" | "merge" | "check" | ["insert", string];
|
|
7
4
|
to: string;
|
|
8
5
|
};
|
|
9
|
-
content
|
|
6
|
+
content?: string | undefined;
|
|
10
7
|
}[]>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { type TemplateRender } from '../TemplateRender.js';
|
|
2
|
-
|
|
3
|
-
export declare function mergeUsingTemplateRender(templateRender: TemplateRender | TemplateRenderSnapshot, basePath: string): Promise<void>;
|
|
2
|
+
export declare function mergeUsingTemplateRender(templateRender: TemplateRender, basePath: string): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../source/template/internals/mergeUsingTemplateRender.ts"],
|
|
4
|
-
"sourcesContent": ["import {type Json} from '@jakubmazanec/zod-utils';\nimport fs from 'fs-extra';\nimport json from 'json5';\nimport path from 'node:path';\nimport yaml from 'yaml';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {merge} from './merge.js';\nimport {prettify} from './prettify.js';\
|
|
5
|
-
"mappings": ";AACA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAElC,SAAQ,aAAY;AACpB,SAAQ,gBAAe;
|
|
4
|
+
"sourcesContent": ["import {type Json} from '@jakubmazanec/zod-utils';\nimport fs from 'fs-extra';\nimport json from 'json5';\nimport path from 'node:path';\nimport yaml from 'yaml';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {merge} from './merge.js';\nimport {prettify} from './prettify.js';\n\nexport async function mergeUsingTemplateRender(templateRender: TemplateRender, basePath: string) {\n let to = path.join(basePath, templateRender.attributes.to);\n let extension = path.extname(to);\n\n switch (extension) {\n case '.json': {\n if (await fs.pathExists(to)) {\n let targetFile = (await fs.readJson(to)) as Json;\n let fileToMerge = json.parse<Json>(templateRender.content);\n let newFile = JSON.stringify(merge(targetFile, fileToMerge), null, 2);\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n } else {\n await fs.writeFile(to, await prettify(templateRender.content, to), {encoding: 'utf8'});\n }\n\n break;\n }\n\n case '.yaml': {\n if (await fs.pathExists(to)) {\n let targetFile = yaml.parse(await fs.readFile(to, {encoding: 'utf8'})) as unknown;\n let fileToMerge = yaml.parse(templateRender.content) as unknown;\n let newFile = yaml.stringify(merge(targetFile, fileToMerge));\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n } else {\n await fs.writeFile(to, await prettify(templateRender.content, to), {encoding: 'utf8'});\n }\n\n break;\n }\n\n default: {\n throw new CarsonTemplateError('STRATEGY_UNSUPPORTED_EXTENSION', {\n messageParameters: [\n templateRender.attributes.strategy,\n templateRender.template.path,\n extension,\n ],\n data: {\n path: templateRender.template.path,\n },\n });\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AACA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAElC,SAAQ,aAAY;AACpB,SAAQ,gBAAe;AAEvB,sBAAsB,yBAAyB,gBAAgC,UAAkB;AAC/F,MAAI,KAAK,KAAK,KAAK,UAAU,eAAe,WAAW,EAAE;AACzD,MAAI,YAAY,KAAK,QAAQ,EAAE;AAE/B,UAAQ,WAAW;AAAA,IACjB,KAAK,SAAS;AACZ,UAAI,MAAM,GAAG,WAAW,EAAE,GAAG;AAC3B,YAAI,aAAc,MAAM,GAAG,SAAS,EAAE;AACtC,YAAI,cAAc,KAAK,MAAY,eAAe,OAAO;AACzD,YAAI,UAAU,KAAK,UAAU,MAAM,YAAY,WAAW,GAAG,MAAM,CAAC;AAEpE,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACxE,OAAO;AACL,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,eAAe,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACvF;AAEA;AAAA,IACF;AAAA,IAEA,KAAK,SAAS;AACZ,UAAI,MAAM,GAAG,WAAW,EAAE,GAAG;AAC3B,YAAI,aAAa,KAAK,MAAM,MAAM,GAAG,SAAS,IAAI,EAAC,UAAU,OAAM,CAAC,CAAC;AACrE,YAAI,cAAc,KAAK,MAAM,eAAe,OAAO;AACnD,YAAI,UAAU,KAAK,UAAU,MAAM,YAAY,WAAW,CAAC;AAE3D,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACxE,OAAO;AACL,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,eAAe,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACvF;AAEA;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,IAAI,oBAAoB,kCAAkC;AAAA,QAC9D,mBAAmB;AAAA,UACjB,eAAe,WAAW;AAAA,UAC1B,eAAe,SAAS;AAAA,UACxB;AAAA,QACF;AAAA,QACA,MAAM;AAAA,UACJ,MAAM,eAAe,SAAS;AAAA,QAChC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { type TemplateRender } from '../TemplateRender.js';
|
|
2
|
-
|
|
3
|
-
export declare function overwriteUsingTemplateRender(templateRender: TemplateRender | TemplateRenderSnapshot, basePath: string): Promise<void>;
|
|
2
|
+
export declare function overwriteUsingTemplateRender(templateRender: TemplateRender, basePath: string): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../source/template/internals/overwriteUsingTemplateRender.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs-extra';\nimport path from 'node:path';\n\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {prettify} from './prettify.js';\
|
|
5
|
-
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGjB,SAAQ,gBAAe;
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\nimport path from 'node:path';\n\nimport {type TemplateRender} from '../TemplateRender.js';\nimport {prettify} from './prettify.js';\n\nexport async function overwriteUsingTemplateRender(\n templateRender: TemplateRender,\n basePath: string,\n) {\n let to = path.join(basePath, templateRender.attributes.to);\n\n await fs.ensureDir(path.dirname(to));\n await fs.writeFile(to, await prettify(templateRender.content, to), {encoding: 'utf8'});\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGjB,SAAQ,gBAAe;AAEvB,sBAAsB,6BACpB,gBACA,UACA;AACA,MAAI,KAAK,KAAK,KAAK,UAAU,eAAe,WAAW,EAAE;AAEzD,QAAM,GAAG,UAAU,KAAK,QAAQ,EAAE,CAAC;AACnC,QAAM,GAAG,UAAU,IAAI,MAAM,SAAS,eAAe,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AACvF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { deflateSync, strToU8 } from "fflate";
|
|
3
3
|
import fs from "fs-extra";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import yaml from "yaml";
|
|
6
|
+
import { simplify } from "./simplify.js";
|
|
4
7
|
export async function saveTemplateRenderSnapshots(templateRenders, templateRenderSnapshotsPath) {
|
|
5
8
|
let templateRendersSnapshots = [];
|
|
6
9
|
for (let templateRender of templateRenders) {
|
|
7
|
-
if (templateRender.attributes.strategy === "
|
|
10
|
+
if (templateRender.attributes.strategy === "overwrite" || templateRender.attributes.strategy[0] === "insert") {
|
|
11
|
+
templateRendersSnapshots.push({
|
|
12
|
+
attributes: {
|
|
13
|
+
to: templateRender.attributes.to,
|
|
14
|
+
strategy: templateRender.attributes.strategy
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (templateRender.attributes.strategy === "ensure") {
|
|
20
|
+
templateRendersSnapshots.push({
|
|
21
|
+
attributes: {
|
|
22
|
+
to: templateRender.attributes.to,
|
|
23
|
+
strategy: templateRender.attributes.strategy
|
|
24
|
+
},
|
|
25
|
+
content: templateRender.content
|
|
26
|
+
});
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (templateRender.attributes.strategy === "merge") {
|
|
30
|
+
let extension = path.extname(templateRender.attributes.to);
|
|
31
|
+
let content;
|
|
32
|
+
switch (extension) {
|
|
33
|
+
case ".json": {
|
|
34
|
+
content = JSON.stringify(simplify(JSON.parse(templateRender.content)));
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case ".yaml": {
|
|
38
|
+
content = yaml.stringify(simplify(yaml.parse(templateRender.content)));
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
default: {
|
|
42
|
+
content = templateRender.content;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
8
45
|
templateRendersSnapshots.push({
|
|
9
46
|
attributes: {
|
|
10
47
|
to: templateRender.attributes.to,
|
|
11
48
|
strategy: templateRender.attributes.strategy
|
|
12
49
|
},
|
|
13
|
-
content
|
|
14
|
-
template: templateRender.template
|
|
50
|
+
content
|
|
15
51
|
});
|
|
52
|
+
continue;
|
|
16
53
|
}
|
|
17
54
|
}
|
|
18
55
|
await fs.writeFile(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../source/template/internals/saveTemplateRenderSnapshots.ts"],
|
|
4
|
-
"sourcesContent": ["import {deflateSync, strToU8} from 'fflate';\nimport fs from 'fs-extra';\n\nimport {type TemplateRenders} from '../TemplateRenders.js';\nimport {type TemplateRenderSnapshots} from './TemplateRenderSnapshots.js';\n\nexport async function saveTemplateRenderSnapshots(\n templateRenders: TemplateRenders,\n templateRenderSnapshotsPath: string,\n) {\n let templateRendersSnapshots: TemplateRenderSnapshots = [];\n\n for (let templateRender of templateRenders) {\n if (\n templateRender.attributes.strategy === '
|
|
5
|
-
"mappings": ";AAAA,SAAQ,aAAa,eAAc;AACnC,OAAO,QAAQ;
|
|
4
|
+
"sourcesContent": ["import {deflateSync, strToU8} from 'fflate';\nimport fs from 'fs-extra';\nimport path from 'node:path';\nimport yaml from 'yaml';\n\nimport {type TemplateRenders} from '../TemplateRenders.js';\nimport {simplify} from './simplify.js';\nimport {type TemplateRenderSnapshots} from './TemplateRenderSnapshots.js';\n\nexport async function saveTemplateRenderSnapshots(\n templateRenders: TemplateRenders,\n templateRenderSnapshotsPath: string,\n) {\n let templateRendersSnapshots: TemplateRenderSnapshots = [];\n\n for (let templateRender of templateRenders) {\n if (\n templateRender.attributes.strategy === 'overwrite' ||\n templateRender.attributes.strategy[0] === 'insert'\n ) {\n templateRendersSnapshots.push({\n attributes: {\n to: templateRender.attributes.to,\n strategy: templateRender.attributes.strategy,\n },\n });\n\n continue;\n }\n\n if (templateRender.attributes.strategy === 'ensure') {\n templateRendersSnapshots.push({\n attributes: {\n to: templateRender.attributes.to,\n strategy: templateRender.attributes.strategy,\n },\n content: templateRender.content,\n });\n\n continue;\n }\n\n if (templateRender.attributes.strategy === 'merge') {\n let extension = path.extname(templateRender.attributes.to);\n let content;\n\n switch (extension) {\n case '.json': {\n content = JSON.stringify(simplify(JSON.parse(templateRender.content)));\n\n break;\n }\n\n case '.yaml': {\n content = yaml.stringify(simplify(yaml.parse(templateRender.content)));\n\n break;\n }\n\n default: {\n content = templateRender.content;\n }\n }\n\n templateRendersSnapshots.push({\n attributes: {\n to: templateRender.attributes.to,\n strategy: templateRender.attributes.strategy,\n },\n content,\n });\n\n continue;\n }\n }\n\n await fs.writeFile(\n templateRenderSnapshotsPath,\n deflateSync(strToU8(JSON.stringify(templateRendersSnapshots)), {level: 1, mem: 0}),\n );\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,aAAa,eAAc;AACnC,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AAGjB,SAAQ,gBAAe;AAGvB,sBAAsB,4BACpB,iBACA,6BACA;AACA,MAAI,2BAAoD,CAAC;AAEzD,WAAS,kBAAkB,iBAAiB;AAC1C,QACE,eAAe,WAAW,aAAa,eACvC,eAAe,WAAW,SAAS,CAAC,MAAM,UAC1C;AACA,+BAAyB,KAAK;AAAA,QAC5B,YAAY;AAAA,UACV,IAAI,eAAe,WAAW;AAAA,UAC9B,UAAU,eAAe,WAAW;AAAA,QACtC;AAAA,MACF,CAAC;AAED;AAAA,IACF;AAEA,QAAI,eAAe,WAAW,aAAa,UAAU;AACnD,+BAAyB,KAAK;AAAA,QAC5B,YAAY;AAAA,UACV,IAAI,eAAe,WAAW;AAAA,UAC9B,UAAU,eAAe,WAAW;AAAA,QACtC;AAAA,QACA,SAAS,eAAe;AAAA,MAC1B,CAAC;AAED;AAAA,IACF;AAEA,QAAI,eAAe,WAAW,aAAa,SAAS;AAClD,UAAI,YAAY,KAAK,QAAQ,eAAe,WAAW,EAAE;AACzD,UAAI;AAEJ,cAAQ,WAAW;AAAA,QACjB,KAAK,SAAS;AACZ,oBAAU,KAAK,UAAU,SAAS,KAAK,MAAM,eAAe,OAAO,CAAC,CAAC;AAErE;AAAA,QACF;AAAA,QAEA,KAAK,SAAS;AACZ,oBAAU,KAAK,UAAU,SAAS,KAAK,MAAM,eAAe,OAAO,CAAC,CAAC;AAErE;AAAA,QACF;AAAA,QAEA,SAAS;AACP,oBAAU,eAAe;AAAA,QAC3B;AAAA,MACF;AAEA,+BAAyB,KAAK;AAAA,QAC5B,YAAY;AAAA,UACV,IAAI,eAAe,WAAW;AAAA,UAC9B,UAAU,eAAe,WAAW;AAAA,QACtC;AAAA,QACA;AAAA,MACF,CAAC;AAED;AAAA,IACF;AAAA,EACF;AAEA,QAAM,GAAG;AAAA,IACP;AAAA,IACA,YAAY,QAAQ,KAAK,UAAU,wBAAwB,CAAC,GAAG,EAAC,OAAO,GAAG,KAAK,EAAC,CAAC;AAAA,EACnF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export function simplify(a) {
|
|
3
|
+
if (a === void 0 || a == null) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
if (typeof a !== "object" || Array.isArray(a)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const newA = { ...a };
|
|
10
|
+
for (let [key] of Object.entries(a)) {
|
|
11
|
+
if (a[key] && typeof a[key] === "object" && !Array.isArray(a[key])) {
|
|
12
|
+
const result = simplify(a[key]);
|
|
13
|
+
newA[key] = result;
|
|
14
|
+
} else {
|
|
15
|
+
newA[key] = null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return newA;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=simplify.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/template/internals/simplify.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Simplifies JSON for usage in snapshots: string, number or boolean values are replaced with `null`.\n */\nexport function simplify(a: unknown) {\n if (a === undefined || a == null) {\n return null;\n }\n\n if (typeof a !== 'object' || Array.isArray(a)) {\n return null;\n }\n\n const newA: Record<string, unknown> = {...a};\n\n for (let [key] of Object.entries(a)) {\n if (\n (a as Record<string, unknown>)[key] &&\n typeof (a as Record<string, unknown>)[key] === 'object' &&\n !Array.isArray((a as Record<string, unknown>)[key])\n ) {\n const result = simplify((a as Record<string, unknown>)[key]);\n\n newA[key] = result;\n } else {\n newA[key] = null;\n }\n }\n\n return newA;\n}\n"],
|
|
5
|
+
"mappings": ";AAGO,gBAAS,SAAS,GAAY;AACnC,MAAI,MAAM,UAAa,KAAK,MAAM;AAChC,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AAEA,QAAM,OAAgC,EAAC,GAAG,EAAC;AAE3C,WAAS,CAAC,GAAG,KAAK,OAAO,QAAQ,CAAC,GAAG;AACnC,QACG,EAA8B,GAAG,KAClC,OAAQ,EAA8B,GAAG,MAAM,YAC/C,CAAC,MAAM,QAAS,EAA8B,GAAG,CAAC,GAClD;AACA,YAAM,SAAS,SAAU,EAA8B,GAAG,CAAC;AAE3D,WAAK,GAAG,IAAI;AAAA,IACd,OAAO;AACL,WAAK,GAAG,IAAI;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -4,18 +4,18 @@ import _ from "lodash";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { CarsonTemplateError } from "../CarsonTemplateError.js";
|
|
6
6
|
import { prettify } from "./prettify.js";
|
|
7
|
-
export async function
|
|
8
|
-
let to = path.join(basePath,
|
|
7
|
+
export async function uninsertUsingTemplateRenderSnapshot(templateRenderSnapshot, basePath) {
|
|
8
|
+
let to = path.join(basePath, templateRenderSnapshot.attributes.to);
|
|
9
9
|
let extension = path.extname(to);
|
|
10
10
|
switch (extension) {
|
|
11
11
|
case ".md": {
|
|
12
12
|
if (await fs.pathExists(to)) {
|
|
13
13
|
let targetFile = await fs.readFile(to, { encoding: "utf8" });
|
|
14
|
-
let newContent = `<!-- ${
|
|
14
|
+
let newContent = `<!-- ${templateRenderSnapshot.attributes.strategy[1]} --><!-- ${templateRenderSnapshot.attributes.strategy[1]} -->`;
|
|
15
15
|
let oldContentRegexp = new RegExp(
|
|
16
16
|
`<!--\\s*${_.escapeRegExp(
|
|
17
|
-
|
|
18
|
-
)}\\s-->[\\s\\S]*<!--\\s*${_.escapeRegExp(
|
|
17
|
+
templateRenderSnapshot.attributes.strategy[1]
|
|
18
|
+
)}\\s-->[\\s\\S]*<!--\\s*${_.escapeRegExp(templateRenderSnapshot.attributes.strategy[1])}\\s-->`,
|
|
19
19
|
"u"
|
|
20
20
|
);
|
|
21
21
|
let newFile = targetFile.replace(oldContentRegexp, newContent);
|
|
@@ -24,17 +24,8 @@ export async function uninsertUsingTemplateRender(templateRender, basePath) {
|
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
default: {
|
|
27
|
-
throw new CarsonTemplateError("
|
|
28
|
-
messageParameters: [
|
|
29
|
-
templateRender.attributes.strategy,
|
|
30
|
-
templateRender.template.path,
|
|
31
|
-
extension
|
|
32
|
-
],
|
|
33
|
-
data: {
|
|
34
|
-
path: templateRender.template.path
|
|
35
|
-
}
|
|
36
|
-
});
|
|
27
|
+
throw new CarsonTemplateError("INVALID_SNAPSHOT");
|
|
37
28
|
}
|
|
38
29
|
}
|
|
39
30
|
}
|
|
40
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=uninsertUsingTemplateRenderSnapshot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/template/internals/uninsertUsingTemplateRenderSnapshot.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from 'fs-extra';\nimport _ from 'lodash';\nimport path from 'node:path';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {prettify} from './prettify.js';\nimport {type TemplateRenderSnapshot} from './TemplateRenderSnapshot.js';\n\nexport async function uninsertUsingTemplateRenderSnapshot(\n templateRenderSnapshot: TemplateRenderSnapshot,\n basePath: string,\n) {\n let to = path.join(basePath, templateRenderSnapshot.attributes.to);\n let extension = path.extname(to);\n\n switch (extension) {\n case '.md': {\n if (await fs.pathExists(to)) {\n let targetFile = await fs.readFile(to, {encoding: 'utf8'});\n let newContent = `<!-- ${templateRenderSnapshot.attributes.strategy[1]} --><!-- ${templateRenderSnapshot.attributes.strategy[1]} -->`;\n let oldContentRegexp = new RegExp(\n `<!--\\\\s*${_.escapeRegExp(\n templateRenderSnapshot.attributes.strategy[1],\n )}\\\\s-->[\\\\s\\\\S]*<!--\\\\s*${_.escapeRegExp(templateRenderSnapshot.attributes.strategy[1])}\\\\s-->`,\n 'u',\n );\n let newFile = targetFile.replace(oldContentRegexp, newContent);\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n }\n\n break;\n }\n\n default: {\n throw new CarsonTemplateError('INVALID_SNAPSHOT');\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,OAAO;AACd,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAClC,SAAQ,gBAAe;AAGvB,sBAAsB,oCACpB,wBACA,UACA;AACA,MAAI,KAAK,KAAK,KAAK,UAAU,uBAAuB,WAAW,EAAE;AACjE,MAAI,YAAY,KAAK,QAAQ,EAAE;AAE/B,UAAQ,WAAW;AAAA,IACjB,KAAK,OAAO;AACV,UAAI,MAAM,GAAG,WAAW,EAAE,GAAG;AAC3B,YAAI,aAAa,MAAM,GAAG,SAAS,IAAI,EAAC,UAAU,OAAM,CAAC;AACzD,YAAI,aAAa,QAAQ,uBAAuB,WAAW,SAAS,CAAC,CAAC,YAAY,uBAAuB,WAAW,SAAS,CAAC,CAAC;AAC/H,YAAI,mBAAmB,IAAI;AAAA,UACzB,WAAW,EAAE;AAAA,YACX,uBAAuB,WAAW,SAAS,CAAC;AAAA,UAC9C,CAAC,0BAA0B,EAAE,aAAa,uBAAuB,WAAW,SAAS,CAAC,CAAC,CAAC;AAAA,UACxF;AAAA,QACF;AACA,YAAI,UAAU,WAAW,QAAQ,kBAAkB,UAAU;AAE7D,cAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAAA,MACxE;AAEA;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,IAAI,oBAAoB,kBAAkB;AAAA,IAClD;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -6,36 +6,30 @@ import yaml from "yaml";
|
|
|
6
6
|
import { CarsonTemplateError } from "../CarsonTemplateError.js";
|
|
7
7
|
import { prettify } from "./prettify.js";
|
|
8
8
|
import { unmerge } from "./unmerge.js";
|
|
9
|
-
export async function
|
|
10
|
-
let to = path.join(outputPath,
|
|
9
|
+
export async function unmergeUsingTemplateRenderSnapshot(templateRenderSnapshot, outputPath) {
|
|
10
|
+
let to = path.join(outputPath, templateRenderSnapshot.attributes.to);
|
|
11
11
|
let extension = path.extname(to);
|
|
12
|
+
if (!templateRenderSnapshot.content) {
|
|
13
|
+
throw new CarsonTemplateError("INVALID_SNAPSHOT");
|
|
14
|
+
}
|
|
12
15
|
switch (extension) {
|
|
13
16
|
case ".json": {
|
|
14
17
|
let targetFile = await fs.readJson(to);
|
|
15
|
-
let fileToMerge = json.parse(
|
|
18
|
+
let fileToMerge = json.parse(templateRenderSnapshot.content);
|
|
16
19
|
let newFile = JSON.stringify(unmerge(targetFile, fileToMerge));
|
|
17
20
|
await fs.writeFile(to, await prettify(newFile, to), { encoding: "utf8" });
|
|
18
21
|
break;
|
|
19
22
|
}
|
|
20
23
|
case ".yaml": {
|
|
21
24
|
let targetFile = yaml.parse(await fs.readFile(to, { encoding: "utf8" }));
|
|
22
|
-
let fileToMerge = yaml.parse(
|
|
25
|
+
let fileToMerge = yaml.parse(templateRenderSnapshot.content);
|
|
23
26
|
let newFile = yaml.stringify(unmerge(targetFile, fileToMerge));
|
|
24
27
|
await fs.writeFile(to, await prettify(newFile, to), { encoding: "utf8" });
|
|
25
28
|
break;
|
|
26
29
|
}
|
|
27
30
|
default: {
|
|
28
|
-
throw new CarsonTemplateError("
|
|
29
|
-
messageParameters: [
|
|
30
|
-
templateRender.attributes.strategy,
|
|
31
|
-
templateRender.template.path,
|
|
32
|
-
extension
|
|
33
|
-
],
|
|
34
|
-
data: {
|
|
35
|
-
path: templateRender.template.path
|
|
36
|
-
}
|
|
37
|
-
});
|
|
31
|
+
throw new CarsonTemplateError("INVALID_SNAPSHOT");
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=unmergeUsingTemplateRenderSnapshot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/template/internals/unmergeUsingTemplateRenderSnapshot.ts"],
|
|
4
|
+
"sourcesContent": ["import {type Json} from '@jakubmazanec/zod-utils';\nimport fs from 'fs-extra';\nimport json from 'json5';\nimport path from 'node:path';\nimport yaml from 'yaml';\n\nimport {CarsonTemplateError} from '../CarsonTemplateError.js';\nimport {prettify} from './prettify.js';\nimport {type TemplateRenderSnapshot} from './TemplateRenderSnapshot.js';\nimport {unmerge} from './unmerge.js';\n\nexport async function unmergeUsingTemplateRenderSnapshot(\n templateRenderSnapshot: TemplateRenderSnapshot,\n outputPath: string,\n) {\n let to = path.join(outputPath, templateRenderSnapshot.attributes.to);\n let extension = path.extname(to);\n\n if (!templateRenderSnapshot.content) {\n throw new CarsonTemplateError('INVALID_SNAPSHOT');\n }\n\n switch (extension) {\n case '.json': {\n let targetFile = (await fs.readJson(to)) as Json;\n let fileToMerge = json.parse<Json>(templateRenderSnapshot.content);\n let newFile = JSON.stringify(unmerge(targetFile, fileToMerge));\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n\n break;\n }\n\n case '.yaml': {\n let targetFile = yaml.parse(await fs.readFile(to, {encoding: 'utf8'})) as unknown;\n let fileToMerge = yaml.parse(templateRenderSnapshot.content) as unknown;\n let newFile = yaml.stringify(unmerge(targetFile, fileToMerge));\n\n await fs.writeFile(to, await prettify(newFile, to), {encoding: 'utf8'});\n\n break;\n }\n\n default: {\n throw new CarsonTemplateError('INVALID_SNAPSHOT');\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";AACA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,UAAU;AAEjB,SAAQ,2BAA0B;AAClC,SAAQ,gBAAe;AAEvB,SAAQ,eAAc;AAEtB,sBAAsB,mCACpB,wBACA,YACA;AACA,MAAI,KAAK,KAAK,KAAK,YAAY,uBAAuB,WAAW,EAAE;AACnE,MAAI,YAAY,KAAK,QAAQ,EAAE;AAE/B,MAAI,CAAC,uBAAuB,SAAS;AACnC,UAAM,IAAI,oBAAoB,kBAAkB;AAAA,EAClD;AAEA,UAAQ,WAAW;AAAA,IACjB,KAAK,SAAS;AACZ,UAAI,aAAc,MAAM,GAAG,SAAS,EAAE;AACtC,UAAI,cAAc,KAAK,MAAY,uBAAuB,OAAO;AACjE,UAAI,UAAU,KAAK,UAAU,QAAQ,YAAY,WAAW,CAAC;AAE7D,YAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAEtE;AAAA,IACF;AAAA,IAEA,KAAK,SAAS;AACZ,UAAI,aAAa,KAAK,MAAM,MAAM,GAAG,SAAS,IAAI,EAAC,UAAU,OAAM,CAAC,CAAC;AACrE,UAAI,cAAc,KAAK,MAAM,uBAAuB,OAAO;AAC3D,UAAI,UAAU,KAAK,UAAU,QAAQ,YAAY,WAAW,CAAC;AAE7D,YAAM,GAAG,UAAU,IAAI,MAAM,SAAS,SAAS,EAAE,GAAG,EAAC,UAAU,OAAM,CAAC;AAEtE;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,IAAI,oBAAoB,kBAAkB;AAAA,IAClD;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './internals/createUsingTemplateRender.js';
|
|
2
|
-
export * from './internals/
|
|
2
|
+
export * from './internals/deleteUsingTemplateRenderSnapshot.js';
|
|
3
3
|
export * from './internals/importCarsonTemplate.js';
|
|
4
4
|
export * from './internals/insertUsingTemplateRender.js';
|
|
5
5
|
export * from './internals/loadTemplateRenderSnapshots.js';
|
|
@@ -11,8 +11,9 @@ export * from './internals/prettify.js';
|
|
|
11
11
|
export * from './internals/readCarsonTemplate.js';
|
|
12
12
|
export * from './internals/resolveModule.js';
|
|
13
13
|
export * from './internals/saveTemplateRenderSnapshots.js';
|
|
14
|
+
export * from './internals/simplify.js';
|
|
14
15
|
export * from './internals/TemplateRenderSnapshot.js';
|
|
15
16
|
export * from './internals/TemplateRenderSnapshots.js';
|
|
16
|
-
export * from './internals/
|
|
17
|
+
export * from './internals/uninsertUsingTemplateRenderSnapshot.js';
|
|
17
18
|
export * from './internals/unmerge.js';
|
|
18
|
-
export * from './internals/
|
|
19
|
+
export * from './internals/unmergeUsingTemplateRenderSnapshot.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export * from "./internals/createUsingTemplateRender.js";
|
|
3
|
-
export * from "./internals/
|
|
3
|
+
export * from "./internals/deleteUsingTemplateRenderSnapshot.js";
|
|
4
4
|
export * from "./internals/importCarsonTemplate.js";
|
|
5
5
|
export * from "./internals/insertUsingTemplateRender.js";
|
|
6
6
|
export * from "./internals/loadTemplateRenderSnapshots.js";
|
|
@@ -12,9 +12,10 @@ export * from "./internals/prettify.js";
|
|
|
12
12
|
export * from "./internals/readCarsonTemplate.js";
|
|
13
13
|
export * from "./internals/resolveModule.js";
|
|
14
14
|
export * from "./internals/saveTemplateRenderSnapshots.js";
|
|
15
|
+
export * from "./internals/simplify.js";
|
|
15
16
|
export * from "./internals/TemplateRenderSnapshot.js";
|
|
16
17
|
export * from "./internals/TemplateRenderSnapshots.js";
|
|
17
|
-
export * from "./internals/
|
|
18
|
+
export * from "./internals/uninsertUsingTemplateRenderSnapshot.js";
|
|
18
19
|
export * from "./internals/unmerge.js";
|
|
19
|
-
export * from "./internals/
|
|
20
|
+
export * from "./internals/unmergeUsingTemplateRenderSnapshot.js";
|
|
20
21
|
//# sourceMappingURL=internals.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../source/template/internals.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './internals/createUsingTemplateRender.js';\nexport * from './internals/
|
|
5
|
-
"mappings": ";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["export * from './internals/createUsingTemplateRender.js';\nexport * from './internals/deleteUsingTemplateRenderSnapshot.js';\nexport * from './internals/importCarsonTemplate.js';\nexport * from './internals/insertUsingTemplateRender.js';\nexport * from './internals/loadTemplateRenderSnapshots.js';\nexport * from './internals/merge.js';\nexport * from './internals/mergeUsingTemplateRender.js';\nexport * from './internals/overwriteUsingTemplateRender.js';\nexport * from './internals/parseCarsonTemplateId.js';\nexport * from './internals/prettify.js';\nexport * from './internals/readCarsonTemplate.js';\nexport * from './internals/resolveModule.js';\nexport * from './internals/saveTemplateRenderSnapshots.js';\nexport * from './internals/simplify.js';\nexport * from './internals/TemplateRenderSnapshot.js';\nexport * from './internals/TemplateRenderSnapshots.js';\nexport * from './internals/uninsertUsingTemplateRenderSnapshot.js';\nexport * from './internals/unmerge.js';\nexport * from './internals/unmergeUsingTemplateRenderSnapshot.js';\n"],
|
|
5
|
+
"mappings": ";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/template.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './template/applyTemplateRenders.js';
|
|
2
|
-
export * from './template/CarsonTemplate.js';
|
|
2
|
+
export type * from './template/CarsonTemplate.js';
|
|
3
3
|
export * from './template/CarsonTemplateConfig.js';
|
|
4
4
|
export * from './template/CarsonTemplateError.js';
|
|
5
5
|
export * from './template/renderCarsonTemplate.js';
|
|
6
6
|
export * from './template/TemplateAttributes.js';
|
|
7
7
|
export * from './template/TemplateData.js';
|
|
8
|
-
export * from './template/TemplateRender.js';
|
|
9
|
-
export * from './template/TemplateRenders.js';
|
|
8
|
+
export type * from './template/TemplateRender.js';
|
|
9
|
+
export type * from './template/TemplateRenders.js';
|
package/build/template.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export * from "./template/applyTemplateRenders.js";
|
|
3
|
-
export * from "./template/CarsonTemplate.js";
|
|
4
3
|
export * from "./template/CarsonTemplateConfig.js";
|
|
5
4
|
export * from "./template/CarsonTemplateError.js";
|
|
6
5
|
export * from "./template/renderCarsonTemplate.js";
|
|
7
6
|
export * from "./template/TemplateAttributes.js";
|
|
8
7
|
export * from "./template/TemplateData.js";
|
|
9
|
-
export * from "./template/TemplateRender.js";
|
|
10
|
-
export * from "./template/TemplateRenders.js";
|
|
11
8
|
//# sourceMappingURL=template.js.map
|
package/build/template.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../source/template.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './template/applyTemplateRenders.js';\nexport * from './template/CarsonTemplate.js';\nexport * from './template/CarsonTemplateConfig.js';\nexport * from './template/CarsonTemplateError.js';\nexport * from './template/renderCarsonTemplate.js';\nexport * from './template/TemplateAttributes.js';\nexport * from './template/TemplateData.js';\nexport * from './template/TemplateRender.js';\nexport * from './template/TemplateRenders.js';\n"],
|
|
5
|
-
"mappings": ";AAAA,cAAc;
|
|
4
|
+
"sourcesContent": ["export * from './template/applyTemplateRenders.js';\nexport type * from './template/CarsonTemplate.js';\nexport * from './template/CarsonTemplateConfig.js';\nexport * from './template/CarsonTemplateError.js';\nexport * from './template/renderCarsonTemplate.js';\nexport * from './template/TemplateAttributes.js';\nexport * from './template/TemplateData.js';\nexport type * from './template/TemplateRender.js';\nexport type * from './template/TemplateRenders.js';\n"],
|
|
5
|
+
"mappings": ";AAAA,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/workspace.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export * from './workspace/Project.js';
|
|
2
2
|
export * from './workspace/ProjectConfig.js';
|
|
3
|
-
export * from './workspace/ProjectCreateOptions.js';
|
|
3
|
+
export type * from './workspace/ProjectCreateOptions.js';
|
|
4
4
|
export * from './workspace/ProjectError.js';
|
|
5
|
-
export * from './workspace/ProjectOptions.js';
|
|
6
|
-
export * from './workspace/ProjectUpdateOptions.js';
|
|
5
|
+
export type * from './workspace/ProjectOptions.js';
|
|
6
|
+
export type * from './workspace/ProjectUpdateOptions.js';
|
|
7
7
|
export * from './workspace/saveProjectConfig.js';
|
|
8
8
|
export * from './workspace/saveWorkspaceConfig.js';
|
|
9
9
|
export * from './workspace/Workspace.js';
|
|
10
10
|
export * from './workspace/WorkspaceConfig.js';
|
|
11
|
-
export * from './workspace/WorkspaceCreateOptions.js';
|
|
12
|
-
export * from './workspace/WorkspaceCreateProjectOptions.js';
|
|
11
|
+
export type * from './workspace/WorkspaceCreateOptions.js';
|
|
12
|
+
export type * from './workspace/WorkspaceCreateProjectOptions.js';
|
|
13
13
|
export * from './workspace/WorkspaceDependencies.js';
|
|
14
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';
|
|
21
|
-
export * from './workspace/WorkspaceRepository.js';
|
|
22
|
-
export * from './workspace/WorkspaceUpdateOptions.js';
|
|
15
|
+
export type * from './workspace/WorkspaceFindAndReadOptions.js';
|
|
16
|
+
export type * from './workspace/WorkspaceOptions.js';
|
|
17
|
+
export type * from './workspace/WorkspaceOptionsProject.js';
|
|
18
|
+
export type * from './workspace/WorkspacePackageJson.js';
|
|
19
|
+
export type * from './workspace/WorkspaceProjectGlobs.js';
|
|
20
|
+
export type * from './workspace/WorkspaceProjects.js';
|
|
21
|
+
export type * from './workspace/WorkspaceRepository.js';
|
|
22
|
+
export type * from './workspace/WorkspaceUpdateOptions.js';
|
package/build/workspace.js
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export * from "./workspace/Project.js";
|
|
3
3
|
export * from "./workspace/ProjectConfig.js";
|
|
4
|
-
export * from "./workspace/ProjectCreateOptions.js";
|
|
5
4
|
export * from "./workspace/ProjectError.js";
|
|
6
|
-
export * from "./workspace/ProjectOptions.js";
|
|
7
|
-
export * from "./workspace/ProjectUpdateOptions.js";
|
|
8
5
|
export * from "./workspace/saveProjectConfig.js";
|
|
9
6
|
export * from "./workspace/saveWorkspaceConfig.js";
|
|
10
7
|
export * from "./workspace/Workspace.js";
|
|
11
8
|
export * from "./workspace/WorkspaceConfig.js";
|
|
12
|
-
export * from "./workspace/WorkspaceCreateOptions.js";
|
|
13
|
-
export * from "./workspace/WorkspaceCreateProjectOptions.js";
|
|
14
9
|
export * from "./workspace/WorkspaceDependencies.js";
|
|
15
10
|
export * from "./workspace/WorkspaceError.js";
|
|
16
|
-
export * from "./workspace/WorkspaceFindAndReadOptions.js";
|
|
17
|
-
export * from "./workspace/WorkspaceOptions.js";
|
|
18
|
-
export * from "./workspace/WorkspaceOptionsProject.js";
|
|
19
|
-
export * from "./workspace/WorkspacePackageJson.js";
|
|
20
|
-
export * from "./workspace/WorkspaceProjectGlobs.js";
|
|
21
|
-
export * from "./workspace/WorkspaceProjects.js";
|
|
22
|
-
export * from "./workspace/WorkspaceRepository.js";
|
|
23
|
-
export * from "./workspace/WorkspaceUpdateOptions.js";
|
|
24
11
|
//# sourceMappingURL=workspace.js.map
|
package/build/workspace.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../source/workspace.ts"],
|
|
4
|
-
"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"],
|
|
5
|
-
"mappings": ";AAAA,cAAc;AACd,cAAc;
|
|
4
|
+
"sourcesContent": ["export * from './workspace/Project.js';\nexport * from './workspace/ProjectConfig.js';\nexport type * from './workspace/ProjectCreateOptions.js';\nexport * from './workspace/ProjectError.js';\nexport type * from './workspace/ProjectOptions.js';\nexport type * 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 type * from './workspace/WorkspaceCreateOptions.js';\nexport type * from './workspace/WorkspaceCreateProjectOptions.js';\nexport * from './workspace/WorkspaceDependencies.js';\nexport * from './workspace/WorkspaceError.js';\nexport type * from './workspace/WorkspaceFindAndReadOptions.js';\nexport type * from './workspace/WorkspaceOptions.js';\nexport type * from './workspace/WorkspaceOptionsProject.js';\nexport type * from './workspace/WorkspacePackageJson.js';\nexport type * from './workspace/WorkspaceProjectGlobs.js';\nexport type * from './workspace/WorkspaceProjects.js';\nexport type * from './workspace/WorkspaceRepository.js';\nexport type * from './workspace/WorkspaceUpdateOptions.js';\n"],
|
|
5
|
+
"mappings": ";AAAA,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|