@devbie/newbie-cli 1.11.0 → 1.12.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.
Files changed (55) hide show
  1. package/dist/assemble/deploy.js +2 -1
  2. package/dist/assemble/deploy.js.map +1 -1
  3. package/dist/assemble/module-source-drift.js +2 -1
  4. package/dist/assemble/module-source-drift.js.map +1 -1
  5. package/dist/assemble/modules-copy.js +6 -6
  6. package/dist/assemble/modules-copy.js.map +1 -1
  7. package/dist/assemble/pipeline.js +12 -12
  8. package/dist/assemble/pipeline.js.map +1 -1
  9. package/dist/assemble/schema.js +2 -1
  10. package/dist/assemble/schema.js.map +1 -1
  11. package/dist/assemble/types.d.ts +1 -1
  12. package/dist/commands/doctor.js +5 -5
  13. package/dist/commands/doctor.js.map +1 -1
  14. package/dist/commands/modules/add.js +1 -1
  15. package/dist/commands/modules/add.js.map +1 -1
  16. package/dist/commands/modules/apply.js +1 -1
  17. package/dist/commands/modules/apply.js.map +1 -1
  18. package/dist/commands/modules/default.js +1 -1
  19. package/dist/commands/modules/default.js.map +1 -1
  20. package/dist/commands/modules/remove.js +1 -1
  21. package/dist/commands/modules/remove.js.map +1 -1
  22. package/dist/commands/modules/update.js +2 -3
  23. package/dist/commands/modules/update.js.map +1 -1
  24. package/dist/commands/modules/watch.js +5 -4
  25. package/dist/commands/modules/watch.js.map +1 -1
  26. package/dist/commands/status.js +2 -3
  27. package/dist/commands/status.js.map +1 -1
  28. package/dist/constants/paths.d.ts +0 -3
  29. package/dist/constants/paths.js +1 -4
  30. package/dist/constants/paths.js.map +1 -1
  31. package/dist/core/modules-state.d.ts +1 -18
  32. package/dist/core/modules-state.js +0 -45
  33. package/dist/core/modules-state.js.map +1 -1
  34. package/dist/lib/module-cli.js +5 -5
  35. package/dist/lib/module-cli.js.map +1 -1
  36. package/dist/lib/module-install.js +4 -4
  37. package/dist/lib/module-install.js.map +1 -1
  38. package/dist/lib/modules-state.d.ts +1 -1
  39. package/dist/lib/modules-state.js +7 -16
  40. package/dist/lib/modules-state.js.map +1 -1
  41. package/dist/lib/registry.js +3 -2
  42. package/dist/lib/registry.js.map +1 -1
  43. package/dist/program.d.ts +1 -0
  44. package/dist/program.js +7 -0
  45. package/dist/program.js.map +1 -1
  46. package/package.json +2 -1
  47. package/dist/commands/modules/install.d.ts +0 -7
  48. package/dist/commands/modules/install.js +0 -121
  49. package/dist/commands/modules/install.js.map +0 -1
  50. package/dist/commands/template/sync.d.ts +0 -7
  51. package/dist/commands/template/sync.js +0 -142
  52. package/dist/commands/template/sync.js.map +0 -1
  53. package/dist/core/template-sync.d.ts +0 -38
  54. package/dist/core/template-sync.js +0 -218
  55. package/dist/core/template-sync.js.map +0 -1
@@ -1,7 +0,0 @@
1
- import { GlobalOptions } from "../shared";
2
- import { TemplateReference } from "../create";
3
- export interface TemplateSyncOptions extends GlobalOptions, TemplateReference {
4
- check?: boolean;
5
- paths?: string[];
6
- }
7
- export declare function runTemplateSync(options: TemplateSyncOptions): Promise<void>;
@@ -1,142 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.runTemplateSync = runTemplateSync;
7
- const promises_1 = __importDefault(require("node:fs/promises"));
8
- const node_path_1 = __importDefault(require("node:path"));
9
- const colorette_1 = require("colorette");
10
- const template_sync_1 = require("../../core/template-sync");
11
- const unified_diff_1 = require("../../core/unified-diff");
12
- const errors_1 = require("../../lib/errors");
13
- const sink_1 = require("../../lib/sink");
14
- const create_1 = require("../create");
15
- function matchesPathFilter(filePath, filter) {
16
- const normalized = filter.replace(/^\.\//, "").replace(/\/+$/, "");
17
- if (normalized === "")
18
- return true;
19
- return filePath === normalized || filePath.startsWith(`${normalized}/`);
20
- }
21
- function filterTemplateFiles(paths) {
22
- const syncable = template_sync_1.TEMPLATE_FILES.filter(template_sync_1.isSyncableTemplateFile);
23
- if (!paths || paths.length === 0)
24
- return syncable;
25
- const selected = syncable.filter((file) => paths.some((p) => matchesPathFilter(file.path, p)));
26
- if (selected.length === 0) {
27
- throw new errors_1.CliError(`No framework-managed template files match the path filter: ${paths.join(", ")}`);
28
- }
29
- return selected;
30
- }
31
- async function readOrNull(root, rel) {
32
- try {
33
- return await promises_1.default.readFile(node_path_1.default.join(root, rel), "utf8");
34
- }
35
- catch {
36
- return null;
37
- }
38
- }
39
- function isScanIgnored(relPath) {
40
- const segments = relPath.split("/");
41
- if (segments.some((segment) => template_sync_1.TEMPLATE_SCAN_IGNORED_DIRECTORIES.has(segment)))
42
- return true;
43
- const base = segments[segments.length - 1];
44
- if (template_sync_1.TEMPLATE_SCAN_IGNORED_FILES.has(base))
45
- return true;
46
- return template_sync_1.TEMPLATE_SCAN_IGNORED_SUFFIXES.some((suffix) => base.endsWith(suffix));
47
- }
48
- async function listTemplateFiles(root) {
49
- const found = [];
50
- async function walk(relDir) {
51
- const dirents = await promises_1.default.readdir(node_path_1.default.join(root, relDir), { withFileTypes: true });
52
- for (const dirent of dirents) {
53
- const relPath = relDir === "" ? dirent.name : `${relDir}/${dirent.name}`;
54
- if (dirent.isDirectory()) {
55
- if (template_sync_1.TEMPLATE_SCAN_IGNORED_DIRECTORIES.has(dirent.name))
56
- continue;
57
- await walk(relPath);
58
- }
59
- else if (dirent.isFile() && !isScanIgnored(relPath)) {
60
- found.push(relPath);
61
- }
62
- }
63
- }
64
- await walk("");
65
- return found;
66
- }
67
- async function assertTemplateRegistryComplete(templateRoot) {
68
- const unclassified = (0, template_sync_1.findUnclassifiedTemplateFiles)(await listTemplateFiles(templateRoot));
69
- if (unclassified.length === 0)
70
- return;
71
- throw new errors_1.CliError(`Template file(s) missing from the ownership registry (ADR-009 D4):\n - ${unclassified.join("\n - ")}\n` +
72
- "Classify each one in TEMPLATE_FILES (packages/newbie-cli/src/core/template-sync.ts).");
73
- }
74
- function printChangeDiff(change) {
75
- const label = change.file.path;
76
- if (change.kind === "missing-markers") {
77
- const markers = (0, template_sync_1.frameworkMarkers)(change.file.markerSyntax);
78
- console.warn((0, colorette_1.yellow)(`! ${label}: framework markers (${markers.start} / ${markers.end}) ` +
79
- "not found; skipping. Add them back to re-enable template sync."));
80
- return;
81
- }
82
- const kindLabel = change.kind === "create" ? "missing in project" : "differs from template";
83
- console.info((0, colorette_1.bold)(`\n# ${label} (${kindLabel})`));
84
- const aLabel = change.currentComparable === null ? "/dev/null" : `a/${label}`;
85
- const diff = (0, unified_diff_1.unifiedDiff)(change.currentComparable ?? "", change.templateComparable ?? "", aLabel, `b/${label}`);
86
- process.stdout.write(diff);
87
- }
88
- async function runTemplateSync(options) {
89
- const cwd = node_path_1.default.resolve(options.cwd);
90
- const sink = (0, sink_1.createSink)(cwd, options.dryRun);
91
- const templateFiles = filterTemplateFiles(options.paths);
92
- const scope = options.paths && options.paths.length > 0 ? options.paths.join(", ") : null;
93
- const template = await (0, create_1.resolveTemplate)(options);
94
- console.info((0, colorette_1.cyan)(`Template source: ${template.source}`));
95
- if (scope) {
96
- console.info((0, colorette_1.cyan)(`Scope: ${scope} (${templateFiles.length} template files)`));
97
- }
98
- await assertTemplateRegistryComplete(template.root);
99
- const projectFiles = new Map();
100
- const templateContents = new Map();
101
- for (const file of templateFiles) {
102
- projectFiles.set(file.path, await readOrNull(cwd, file.path));
103
- templateContents.set(file.path, await readOrNull(template.root, file.path));
104
- }
105
- let changes;
106
- try {
107
- changes = (0, template_sync_1.planTemplateSync)(projectFiles, templateContents, templateFiles);
108
- }
109
- catch (error) {
110
- throw new errors_1.CliError(error.message);
111
- }
112
- if (changes.length === 0) {
113
- const suffix = scope ? ` (scope: ${scope})` : "";
114
- console.info((0, colorette_1.green)((0, colorette_1.bold)(`✓ Project template files are up to date with the template${suffix}.`)));
115
- return;
116
- }
117
- const actionable = changes.filter((c) => c.kind !== "missing-markers");
118
- for (const change of changes) {
119
- printChangeDiff(change);
120
- }
121
- console.info(`\n${actionable.length} template file(s) to sync: ` +
122
- actionable.map((c) => `${c.file.path} (${c.kind})`).join(", "));
123
- if (options.check) {
124
- const command = scope ? `newbie template sync ${scope}` : "newbie template sync";
125
- throw new errors_1.CliError(`${changes.length} template file(s) drift from the template ` +
126
- `(${actionable.length} auto-fixable). ` +
127
- `Run \`${command}\` to apply the template version.`);
128
- }
129
- for (const change of actionable) {
130
- if (change.nextContent !== null) {
131
- await sink.writeText(change.file.path, change.nextContent);
132
- }
133
- }
134
- if (options.dryRun) {
135
- console.info("[dry-run] no files were modified");
136
- }
137
- else {
138
- console.info((0, colorette_1.green)((0, colorette_1.bold)("\n✓ Template files updated.")));
139
- console.info("Review with `git diff`, then commit on a branch and open a PR.");
140
- }
141
- }
142
- //# sourceMappingURL=sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/commands/template/sync.ts"],"names":[],"mappings":";;;;;AA4HA,0CAgEC;AA5LD,gEAAkC;AAClC,0DAA6B;AAC7B,yCAAsD;AAEtD,4DAWkC;AAClC,0DAAsD;AACtD,6CAA4C;AAC5C,yCAA4C;AAE5C,sCAA+D;AAc/D,SAAS,iBAAiB,CAAC,QAAgB,EAAE,MAAc;IACzD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,UAAU,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,mBAAmB,CAAC,KAA2B;IACtD,MAAM,QAAQ,GAAG,8BAAc,CAAC,MAAM,CAAC,sCAAsB,CAAC,CAAC;IAC/D,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAClD,MAAM,Q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CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CAAC,IAAA,iBAAK,EAAC,IAAA,gBAAI,EAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
@@ -1,38 +0,0 @@
1
- export type MarkerSyntax = "//" | "#";
2
- export interface FrameworkMarkers {
3
- start: string;
4
- end: string;
5
- }
6
- export declare function frameworkMarkers(syntax?: MarkerSyntax): FrameworkMarkers;
7
- export type TemplateFileOwnership = "framework-whole-file" | "framework-marker-block" | "generated" | "template-shipped-host-owned";
8
- export type RenderedFragment = {
9
- kind: "line";
10
- pattern: RegExp;
11
- } | {
12
- kind: "block";
13
- start: string;
14
- end: string;
15
- };
16
- export interface TemplateFile {
17
- path: string;
18
- ownership: TemplateFileOwnership;
19
- markerSyntax?: MarkerSyntax;
20
- rendered?: RenderedFragment;
21
- }
22
- export declare const TEMPLATE_FILES: readonly TemplateFile[];
23
- export declare function isSyncableTemplateFile(file: TemplateFile): boolean;
24
- export declare const TEMPLATE_SCAN_IGNORED_DIRECTORIES: ReadonlySet<string>;
25
- export declare const TEMPLATE_SCAN_IGNORED_FILES: ReadonlySet<string>;
26
- export declare const TEMPLATE_SCAN_IGNORED_SUFFIXES: readonly string[];
27
- export declare function findUnclassifiedTemplateFiles(paths: Iterable<string>): string[];
28
- export declare function extractMarkerBlock(content: string, syntax?: MarkerSyntax): string | null;
29
- export declare function replaceMarkerBlock(content: string, block: string, syntax?: MarkerSyntax): string | null;
30
- export type TemplateChangeKind = "create" | "update" | "missing-markers";
31
- export interface TemplateChange {
32
- file: TemplateFile;
33
- kind: TemplateChangeKind;
34
- nextContent: string | null;
35
- currentComparable: string | null;
36
- templateComparable: string | null;
37
- }
38
- export declare function planTemplateSync(projectFiles: ReadonlyMap<string, string | null>, templateFiles: ReadonlyMap<string, string | null>, files?: readonly TemplateFile[]): TemplateChange[];
@@ -1,218 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEMPLATE_SCAN_IGNORED_SUFFIXES = exports.TEMPLATE_SCAN_IGNORED_FILES = exports.TEMPLATE_SCAN_IGNORED_DIRECTORIES = exports.TEMPLATE_FILES = void 0;
4
- exports.frameworkMarkers = frameworkMarkers;
5
- exports.isSyncableTemplateFile = isSyncableTemplateFile;
6
- exports.findUnclassifiedTemplateFiles = findUnclassifiedTemplateFiles;
7
- exports.extractMarkerBlock = extractMarkerBlock;
8
- exports.replaceMarkerBlock = replaceMarkerBlock;
9
- exports.planTemplateSync = planTemplateSync;
10
- const env_file_1 = require("./env-file");
11
- function frameworkMarkers(syntax = "//") {
12
- return {
13
- start: `${syntax} @@newbie-framework-start`,
14
- end: `${syntax} @@newbie-framework-end`,
15
- };
16
- }
17
- exports.TEMPLATE_FILES = [
18
- { path: "src/main.ts", ownership: "framework-whole-file" },
19
- { path: "tsconfig.json", ownership: "framework-whole-file" },
20
- { path: "tsconfig.build.json", ownership: "framework-whole-file" },
21
- { path: "nest-cli.json", ownership: "framework-whole-file" },
22
- { path: "prisma.config.ts", ownership: "framework-whole-file" },
23
- { path: "deploy/compose.framework.yml", ownership: "framework-whole-file" },
24
- {
25
- path: "deploy/Caddyfile.tmpl",
26
- ownership: "framework-whole-file",
27
- rendered: { kind: "block", start: env_file_1.MODULES_MARKER_START, end: env_file_1.MODULES_MARKER_END },
28
- },
29
- { path: "deploy/scripts/lib.sh", ownership: "framework-whole-file" },
30
- { path: "deploy/scripts/render-env.sh", ownership: "framework-whole-file" },
31
- { path: "deploy/scripts/deploy.sh", ownership: "framework-whole-file" },
32
- { path: "deploy/scripts/start.sh", ownership: "framework-whole-file" },
33
- { path: "deploy/scripts/backup.sh", ownership: "framework-whole-file" },
34
- { path: "deploy/scripts/provision.sh", ownership: "framework-whole-file" },
35
- { path: ".env.example", ownership: "framework-marker-block", markerSyntax: "#" },
36
- { path: ".gitignore", ownership: "framework-marker-block", markerSyntax: "#" },
37
- {
38
- path: "prisma/schema.prisma",
39
- ownership: "framework-marker-block",
40
- markerSyntax: "//",
41
- rendered: { kind: "line", pattern: /^\s*schemas\s*=.*$/m },
42
- },
43
- { path: "src/modules/modules.config.ts", ownership: "generated" },
44
- { path: "src/modules/modules.module.ts", ownership: "generated" },
45
- { path: "deploy/compose.modules.yml", ownership: "generated" },
46
- { path: "package.json", ownership: "template-shipped-host-owned" },
47
- { path: ".githooks/pre-commit", ownership: "template-shipped-host-owned" },
48
- { path: ".githooks/commit-msg", ownership: "template-shipped-host-owned" },
49
- { path: "README.md", ownership: "template-shipped-host-owned" },
50
- { path: ".prettierignore", ownership: "template-shipped-host-owned" },
51
- { path: "eslint.config.mjs", ownership: "template-shipped-host-owned" },
52
- { path: "prisma/seed.ts", ownership: "template-shipped-host-owned" },
53
- { path: "src/application/application.controller.ts", ownership: "template-shipped-host-owned" },
54
- { path: "src/application/application.module.ts", ownership: "template-shipped-host-owned" },
55
- { path: "deploy/compose.application.yml", ownership: "template-shipped-host-owned" },
56
- { path: "deploy/clickhouse/config.d/memory.xml", ownership: "template-shipped-host-owned" },
57
- { path: ".github/dependabot.yml", ownership: "template-shipped-host-owned" },
58
- { path: ".github/workflows/ci.yml", ownership: "template-shipped-host-owned" },
59
- { path: ".github/workflows/dependabot-triage.yml", ownership: "template-shipped-host-owned" },
60
- ];
61
- function isSyncableTemplateFile(file) {
62
- return file.ownership === "framework-whole-file" || file.ownership === "framework-marker-block";
63
- }
64
- const SYNCABLE_FILES = exports.TEMPLATE_FILES.filter(isSyncableTemplateFile);
65
- exports.TEMPLATE_SCAN_IGNORED_DIRECTORIES = new Set([
66
- ".git",
67
- ".idea",
68
- ".vscode",
69
- ".newbie",
70
- "coverage",
71
- "dist",
72
- "generated",
73
- "node_modules",
74
- ]);
75
- exports.TEMPLATE_SCAN_IGNORED_FILES = new Set([".DS_Store", ".env", "package-lock.json"]);
76
- exports.TEMPLATE_SCAN_IGNORED_SUFFIXES = [".tsbuildinfo"];
77
- function findUnclassifiedTemplateFiles(paths) {
78
- const registered = new Set(exports.TEMPLATE_FILES.map((file) => file.path));
79
- return [...paths].filter((filePath) => !registered.has(filePath)).sort(env_file_1.compareStrings);
80
- }
81
- function extractMarkerBlock(content, syntax = "//") {
82
- const markers = frameworkMarkers(syntax);
83
- const start = content.indexOf(markers.start);
84
- const end = content.indexOf(markers.end);
85
- if (start === -1 || end === -1 || end < start)
86
- return null;
87
- return content.slice(start, end + markers.end.length);
88
- }
89
- function replaceMarkerBlock(content, block, syntax = "//") {
90
- const current = extractMarkerBlock(content, syntax);
91
- if (current === null)
92
- return null;
93
- return content.replace(current, block);
94
- }
95
- function extractRendered(content, fragment) {
96
- if (fragment.kind === "line") {
97
- return content.match(fragment.pattern)?.[0] ?? null;
98
- }
99
- const start = content.indexOf(fragment.start);
100
- const end = content.indexOf(fragment.end);
101
- if (start === -1 || end === -1 || end < start)
102
- return null;
103
- return content.slice(start, end + fragment.end.length);
104
- }
105
- function replaceRendered(content, fragment, replacement) {
106
- if (fragment.kind === "line") {
107
- if (content.match(fragment.pattern) === null)
108
- return null;
109
- return content.replace(fragment.pattern, () => replacement);
110
- }
111
- const start = content.indexOf(fragment.start);
112
- const end = content.indexOf(fragment.end);
113
- if (start === -1 || end === -1 || end < start)
114
- return null;
115
- return content.slice(0, start) + replacement + content.slice(end + fragment.end.length);
116
- }
117
- function stripRendered(content, fragment) {
118
- if (fragment.kind === "line") {
119
- return content
120
- .split("\n")
121
- .filter((line) => line.match(fragment.pattern) === null)
122
- .join("\n");
123
- }
124
- const current = extractRendered(content, fragment);
125
- return current === null ? content : content.replace(current, "");
126
- }
127
- function carryRendered(templateContent, projectContent, fragment, filePath) {
128
- const projectFragment = extractRendered(projectContent, fragment);
129
- if (projectFragment === null)
130
- return templateContent;
131
- const next = replaceRendered(templateContent, fragment, projectFragment);
132
- if (next === null) {
133
- throw new Error(`Template ${filePath} is missing the assembly-rendered fragment expected by the registry.`);
134
- }
135
- return next;
136
- }
137
- function comparable(file, content) {
138
- let next = content;
139
- if (file.rendered)
140
- next = stripRendered(next, file.rendered);
141
- if (file.ownership === "framework-marker-block") {
142
- const block = extractMarkerBlock(next, file.markerSyntax);
143
- if (block === null) {
144
- throw new Error(`Template ${file.path} is missing the framework block.`);
145
- }
146
- next = block;
147
- }
148
- return next;
149
- }
150
- function planTemplateSync(projectFiles, templateFiles, files = SYNCABLE_FILES) {
151
- const changes = [];
152
- for (const file of files) {
153
- const templateContent = templateFiles.get(file.path);
154
- if (templateContent == null)
155
- continue;
156
- const projectContent = projectFiles.get(file.path);
157
- if (projectContent == null) {
158
- changes.push({
159
- file,
160
- kind: "create",
161
- nextContent: templateContent,
162
- currentComparable: null,
163
- templateComparable: comparable(file, templateContent),
164
- });
165
- continue;
166
- }
167
- if (file.ownership === "framework-marker-block") {
168
- const markers = frameworkMarkers(file.markerSyntax);
169
- const templateBlock = extractMarkerBlock(templateContent, file.markerSyntax);
170
- if (templateBlock === null) {
171
- throw new Error(`Template ${file.path} is missing the framework block ` + `(${markers.start} / ${markers.end}).`);
172
- }
173
- const projectBlock = extractMarkerBlock(projectContent, file.markerSyntax);
174
- if (projectBlock === null) {
175
- changes.push({
176
- file,
177
- kind: "missing-markers",
178
- nextContent: null,
179
- currentComparable: null,
180
- templateComparable: comparable(file, templateContent),
181
- });
182
- continue;
183
- }
184
- const templateComparable = comparable(file, templateContent);
185
- const projectComparable = comparable(file, projectContent);
186
- if (projectComparable !== templateComparable) {
187
- const carried = file.rendered
188
- ? carryRendered(templateContent, projectContent, file.rendered, file.path)
189
- : templateContent;
190
- const nextBlock = extractMarkerBlock(carried, file.markerSyntax);
191
- const nextContent = nextBlock === null ? null : replaceMarkerBlock(projectContent, nextBlock, file.markerSyntax);
192
- changes.push({
193
- file,
194
- kind: "update",
195
- nextContent,
196
- currentComparable: projectComparable,
197
- templateComparable,
198
- });
199
- }
200
- continue;
201
- }
202
- const projectComparable = comparable(file, projectContent);
203
- const templateComparable = comparable(file, templateContent);
204
- if (projectComparable !== templateComparable) {
205
- changes.push({
206
- file,
207
- kind: "update",
208
- nextContent: file.rendered
209
- ? carryRendered(templateContent, projectContent, file.rendered, file.path)
210
- : templateContent,
211
- currentComparable: projectComparable,
212
- templateComparable,
213
- });
214
- }
215
- }
216
- return changes;
217
- }
218
- //# sourceMappingURL=template-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-sync.js","sourceRoot":"","sources":["../../src/core/template-sync.ts"],"names":[],"mappings":";;;AAoCA,4CAKC;AAoFD,wDAEC;AA0BD,sEAGC;AAGD,gDAMC;AAMD,gDAIC;AA+FD,4CAgFC;AArUD,yCAAsF;AAWtF,SAAgB,gBAAgB,CAAC,SAAuB,IAAI;IAC1D,OAAO;QACL,KAAK,EAAE,GAAG,MAAM,2BAA2B;QAC3C,GAAG,EAAE,GAAG,MAAM,yBAAyB;KACxC,CAAC;AACJ,CAAC;AA2BY,QAAA,cAAc,GAA4B;IAErD,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAC1D,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAC5D,EAAE,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAClE,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAC5D,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAI/D,EAAE,IAAI,EAAE,8BAA8B,EAAE,SAAS,EAAE,sBAAsB,EAAE;IAC3E;QACE,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,sBAAsB;QACjC,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,+BAAoB,EAAE,GAAG,EAAE,6BAAkB,EAAE;KAClF;IACD,EAAE,IAAI,EAAE,uBAAuB,EAAE,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