@fgv/repo-template 5.1.0-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.rush/temp/45a8d0dcbb9c2e59fa02645657661dffbd25461f.tar.log +57 -0
  2. package/.rush/temp/92e27a75687fa5062b71fdb897f0928a8aa4e0c9.tar.log +57 -0
  3. package/.rush/temp/chunked-rush-logs/repo-template.build.chunks.jsonl +7 -0
  4. package/.rush/temp/operation/build/all.log +7 -0
  5. package/.rush/temp/operation/build/log-chunks.jsonl +7 -0
  6. package/.rush/temp/operation/build/state.json +3 -0
  7. package/.rush/temp/shrinkwrap-deps.json +576 -0
  8. package/README.md +216 -0
  9. package/bin/repo-template.js +18 -0
  10. package/config/rig.json +4 -0
  11. package/lib/cli.d.ts +14 -0
  12. package/lib/cli.d.ts.map +1 -0
  13. package/lib/cli.js +126 -0
  14. package/lib/cli.js.map +1 -0
  15. package/lib/commands/create.d.ts +17 -0
  16. package/lib/commands/create.d.ts.map +1 -0
  17. package/lib/commands/create.js +212 -0
  18. package/lib/commands/create.js.map +1 -0
  19. package/lib/commands/init-library.d.ts +25 -0
  20. package/lib/commands/init-library.d.ts.map +1 -0
  21. package/lib/commands/init-library.js +217 -0
  22. package/lib/commands/init-library.js.map +1 -0
  23. package/lib/commands/patch.d.ts +15 -0
  24. package/lib/commands/patch.d.ts.map +1 -0
  25. package/lib/commands/patch.js +104 -0
  26. package/lib/commands/patch.js.map +1 -0
  27. package/lib/commands/sync.d.ts +11 -0
  28. package/lib/commands/sync.d.ts.map +1 -0
  29. package/lib/commands/sync.js +156 -0
  30. package/lib/commands/sync.js.map +1 -0
  31. package/lib/index.d.ts +14 -0
  32. package/lib/index.d.ts.map +1 -0
  33. package/lib/index.js +29 -0
  34. package/lib/index.js.map +1 -0
  35. package/lib/packlets/fs/index.d.ts +40 -0
  36. package/lib/packlets/fs/index.d.ts.map +1 -0
  37. package/lib/packlets/fs/index.js +142 -0
  38. package/lib/packlets/fs/index.js.map +1 -0
  39. package/lib/packlets/jsonc/index.d.ts +27 -0
  40. package/lib/packlets/jsonc/index.d.ts.map +1 -0
  41. package/lib/packlets/jsonc/index.js +124 -0
  42. package/lib/packlets/jsonc/index.js.map +1 -0
  43. package/lib/packlets/manifest/index.d.ts +15 -0
  44. package/lib/packlets/manifest/index.d.ts.map +1 -0
  45. package/lib/packlets/manifest/index.js +61 -0
  46. package/lib/packlets/manifest/index.js.map +1 -0
  47. package/lib/packlets/manifest/types.d.ts +33 -0
  48. package/lib/packlets/manifest/types.d.ts.map +1 -0
  49. package/lib/packlets/manifest/types.js +6 -0
  50. package/lib/packlets/manifest/types.js.map +1 -0
  51. package/lib/packlets/template/index.d.ts +22 -0
  52. package/lib/packlets/template/index.d.ts.map +1 -0
  53. package/lib/packlets/template/index.js +75 -0
  54. package/lib/packlets/template/index.js.map +1 -0
  55. package/package.json +32 -0
  56. package/rush-logs/repo-template.build.cache.log +4 -0
  57. package/rush-logs/repo-template.build.log +7 -0
  58. package/src/cli.ts +141 -0
  59. package/src/commands/create.ts +216 -0
  60. package/src/commands/init-library.ts +249 -0
  61. package/src/commands/patch.ts +84 -0
  62. package/src/commands/sync.ts +137 -0
  63. package/src/index.ts +14 -0
  64. package/src/packlets/fs/index.ts +114 -0
  65. package/src/packlets/jsonc/index.ts +134 -0
  66. package/src/packlets/manifest/index.ts +29 -0
  67. package/src/packlets/manifest/types.ts +36 -0
  68. package/src/packlets/template/index.ts +48 -0
  69. package/sync-manifest.json +222 -0
  70. package/temp/build/typescript/ts_l9Fw4VUO.json +1 -0
  71. package/templates/.gitignore.tmpl +85 -0
  72. package/templates/ACTIVE_DEVELOPMENT.md.tmpl +58 -0
  73. package/templates/CLAUDE.md.tmpl +124 -0
  74. package/templates/command-line.json.tmpl +50 -0
  75. package/templates/package.json.tmpl +5 -0
  76. package/templates/version-policies.json.tmpl +8 -0
  77. package/tsconfig.json +7 -0
@@ -0,0 +1 @@
1
+ {"version":3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,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,2BAA2B,SAAS,cAAc,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC","sourcesContent":["/**\n * Sync command — updates shared files in a consumer repo from the template source.\n * Templated files are NOT touched — they are owned by the consumer after creation.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { loadManifest, getDefaultManifestPath } from '../packlets/manifest';\nimport { copyFile, copyPackage, filesAreEqual, getGitCommit } from '../packlets/fs';\n\nexport interface ISyncOptions {\n targetDir: string;\n sourceDir: string;\n dryRun: boolean;\n}\n\nexport async function runSync(options: ISyncOptions): Promise<void> {\n const { targetDir, sourceDir, dryRun } = options;\n\n if (!fs.existsSync(targetDir)) {\n throw new Error(`Target directory does not exist: ${targetDir}`);\n }\n if (!fs.existsSync(path.join(sourceDir, 'rush.json'))) {\n throw new Error(`Source directory is not a Rush repo: ${sourceDir}`);\n }\n\n const manifestPath = getDefaultManifestPath();\n const manifest = loadManifest(manifestPath);\n\n console.log('Syncing shared files');\n console.log(` Source: ${sourceDir}`);\n console.log(` Target: ${targetDir}`);\n if (dryRun) {\n console.log(' Mode: DRY RUN (no changes will be made)');\n }\n console.log('');\n\n let copied = 0;\n let skipped = 0;\n let warnings = 0;\n\n // ── Sync individual shared files ──\n console.log('==> Syncing shared files...');\n\n for (const file of manifest.shared.files) {\n const srcPath = path.join(sourceDir, file.source);\n const dstPath = path.join(targetDir, file.destination);\n\n if (!fs.existsSync(srcPath)) {\n console.log(` WARNING: Source not found: ${file.source}`);\n warnings++;\n continue;\n }\n\n if (dryRun) {\n if (fs.existsSync(dstPath) && filesAreEqual(srcPath, dstPath)) {\n console.log(` [unchanged] ${file.destination}`);\n skipped++;\n } else if (fs.existsSync(dstPath)) {\n console.log(` [would update] ${file.destination}`);\n copied++;\n } else {\n console.log(` [would create] ${file.destination}`);\n copied++;\n }\n } else {\n if (fs.existsSync(dstPath) && filesAreEqual(srcPath, dstPath)) {\n skipped++;\n } else {\n copyFile(srcPath, dstPath);\n console.log(` Updated: ${file.destination}`);\n copied++;\n }\n }\n }\n\n // ── Sync shared packages ──\n console.log('');\n console.log('==> Syncing shared packages...');\n\n for (const pkg of manifest.sharedPackages.packages) {\n const srcPath = path.join(sourceDir, pkg.source);\n const dstPath = path.join(targetDir, pkg.destination);\n\n if (!fs.existsSync(srcPath)) {\n console.log(` WARNING: Source directory not found: ${pkg.source}`);\n warnings++;\n continue;\n }\n\n if (dryRun) {\n console.log(` [would sync] ${pkg.destination}/`);\n copied++;\n } else {\n copyPackage(srcPath, dstPath);\n console.log(` Synced package: ${pkg.destination}`);\n copied++;\n }\n }\n\n // ── Update sync metadata ──\n if (!dryRun) {\n const syncFilePath = path.join(targetDir, '.template-sync');\n if (fs.existsSync(syncFilePath)) {\n try {\n const syncData = JSON.parse(fs.readFileSync(syncFilePath, 'utf-8'));\n syncData.lastSyncedAt = new Date().toISOString();\n syncData.sourceCommit = getGitCommit(sourceDir);\n fs.writeFileSync(syncFilePath, JSON.stringify(syncData, null, 2) + '\\n');\n console.log('');\n console.log(' Updated .template-sync');\n } catch {\n console.log(' WARNING: Could not update .template-sync');\n }\n }\n }\n\n // ── Summary ──\n console.log('');\n console.log('=== Sync complete ===');\n console.log(` Updated: ${copied}`);\n console.log(` Unchanged: ${skipped}`);\n console.log(` Warnings: ${warnings}`);\n\n if (dryRun) {\n console.log('');\n console.log('This was a dry run. No files were modified.');\n console.log('Run without --dry-run to apply changes.');\n }\n\n if (!dryRun && copied > 0) {\n console.log('');\n console.log('Next steps:');\n console.log(` 1. Review changes: cd ${targetDir} && git diff`);\n console.log(\" 2. Commit: git add -A && git commit -m 'Sync shared files from template'\");\n }\n}\n"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @fgv/repo-template — CLI tool for creating and maintaining fgv-derived Rush monorepos.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { RepoTemplateCli } from './cli';
7
+ export { runCreate, ICreateOptions } from './commands/create';
8
+ export { runSync, ISyncOptions } from './commands/sync';
9
+ export { runPatch, IPatchOptions, parsePatchArgs } from './commands/patch';
10
+ export { runInitLibrary, IInitLibraryOptions, RigType, CategoryType } from './commands/init-library';
11
+ export { applyOperations, applyOperation, patchFile, IPatchOperation } from './packlets/jsonc';
12
+ export { loadManifest, IManifest, ISharedFile, ISharedPackage, ITemplatedFile } from './packlets/manifest';
13
+ export { renderTemplate, renderTemplateFile, ITemplateVars } from './packlets/template';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * @fgv/repo-template — CLI tool for creating and maintaining fgv-derived Rush monorepos.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.renderTemplateFile = exports.renderTemplate = exports.loadManifest = exports.patchFile = exports.applyOperation = exports.applyOperations = exports.runInitLibrary = exports.parsePatchArgs = exports.runPatch = exports.runSync = exports.runCreate = exports.RepoTemplateCli = void 0;
9
+ var cli_1 = require("./cli");
10
+ Object.defineProperty(exports, "RepoTemplateCli", { enumerable: true, get: function () { return cli_1.RepoTemplateCli; } });
11
+ var create_1 = require("./commands/create");
12
+ Object.defineProperty(exports, "runCreate", { enumerable: true, get: function () { return create_1.runCreate; } });
13
+ var sync_1 = require("./commands/sync");
14
+ Object.defineProperty(exports, "runSync", { enumerable: true, get: function () { return sync_1.runSync; } });
15
+ var patch_1 = require("./commands/patch");
16
+ Object.defineProperty(exports, "runPatch", { enumerable: true, get: function () { return patch_1.runPatch; } });
17
+ Object.defineProperty(exports, "parsePatchArgs", { enumerable: true, get: function () { return patch_1.parsePatchArgs; } });
18
+ var init_library_1 = require("./commands/init-library");
19
+ Object.defineProperty(exports, "runInitLibrary", { enumerable: true, get: function () { return init_library_1.runInitLibrary; } });
20
+ var jsonc_1 = require("./packlets/jsonc");
21
+ Object.defineProperty(exports, "applyOperations", { enumerable: true, get: function () { return jsonc_1.applyOperations; } });
22
+ Object.defineProperty(exports, "applyOperation", { enumerable: true, get: function () { return jsonc_1.applyOperation; } });
23
+ Object.defineProperty(exports, "patchFile", { enumerable: true, get: function () { return jsonc_1.patchFile; } });
24
+ var manifest_1 = require("./packlets/manifest");
25
+ Object.defineProperty(exports, "loadManifest", { enumerable: true, get: function () { return manifest_1.loadManifest; } });
26
+ var template_1 = require("./packlets/template");
27
+ Object.defineProperty(exports, "renderTemplate", { enumerable: true, get: function () { return template_1.renderTemplate; } });
28
+ Object.defineProperty(exports, "renderTemplateFile", { enumerable: true, get: function () { return template_1.renderTemplateFile; } });
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6BAAwC;AAA/B,sGAAA,eAAe,OAAA;AACxB,4CAA8D;AAArD,mGAAA,SAAS,OAAA;AAClB,wCAAwD;AAA/C,+FAAA,OAAO,OAAA;AAChB,0CAA2E;AAAlE,iGAAA,QAAQ,OAAA;AAAiB,uGAAA,cAAc,OAAA;AAChD,wDAAqG;AAA5F,8GAAA,cAAc,OAAA;AACvB,0CAA+F;AAAtF,wGAAA,eAAe,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAE,kGAAA,SAAS,OAAA;AACnD,gDAA2G;AAAlG,wGAAA,YAAY,OAAA;AACrB,gDAAwF;AAA/E,0GAAA,cAAc,OAAA;AAAE,8GAAA,kBAAkB,OAAA","sourcesContent":["/**\n * @fgv/repo-template — CLI tool for creating and maintaining fgv-derived Rush monorepos.\n *\n * @packageDocumentation\n */\n\nexport { RepoTemplateCli } from './cli';\nexport { runCreate, ICreateOptions } from './commands/create';\nexport { runSync, ISyncOptions } from './commands/sync';\nexport { runPatch, IPatchOptions, parsePatchArgs } from './commands/patch';\nexport { runInitLibrary, IInitLibraryOptions, RigType, CategoryType } from './commands/init-library';\nexport { applyOperations, applyOperation, patchFile, IPatchOperation } from './packlets/jsonc';\nexport { loadManifest, IManifest, ISharedFile, ISharedPackage, ITemplatedFile } from './packlets/manifest';\nexport { renderTemplate, renderTemplateFile, ITemplateVars } from './packlets/template';\n"]}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * File system and shell execution helpers.
3
+ */
4
+ import { ExecSyncOptions } from 'child_process';
5
+ /**
6
+ * Copy a single file, creating parent directories as needed.
7
+ */
8
+ export declare function copyFile(src: string, dest: string): void;
9
+ /**
10
+ * Copy a directory recursively, excluding build artifacts.
11
+ */
12
+ export declare function copyPackage(src: string, dest: string): void;
13
+ /**
14
+ * Compare two files for equality.
15
+ * Returns true if files are identical.
16
+ */
17
+ export declare function filesAreEqual(pathA: string, pathB: string): boolean;
18
+ /**
19
+ * Execute a shell command, returning stdout.
20
+ */
21
+ export declare function exec(command: string, options?: ExecSyncOptions): string;
22
+ /**
23
+ * Execute a shell command, inheriting stdio (output goes to terminal).
24
+ */
25
+ export declare function execInherit(command: string, options?: ExecSyncOptions): void;
26
+ /**
27
+ * Try to get the current git commit hash from a directory.
28
+ * Returns empty string if not a git repo or git is not available.
29
+ */
30
+ export declare function getGitCommit(dir: string): string;
31
+ /**
32
+ * Try to get the git remote URL from a directory.
33
+ */
34
+ export declare function getGitRemoteUrl(dir: string): string;
35
+ /**
36
+ * Auto-detect the fgv source repository root by walking up from a starting directory,
37
+ * looking for a rush.json that belongs to the fgv repo.
38
+ */
39
+ export declare function detectSourceDir(startDir: string): string | undefined;
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/fs/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAY,eAAe,EAAE,MAAM,eAAe,CAAC;AAO1D;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAGxD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAS3D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAOnE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,CAOvE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAK5E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgBpE"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ /**
3
+ * File system and shell execution helpers.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.copyFile = copyFile;
40
+ exports.copyPackage = copyPackage;
41
+ exports.filesAreEqual = filesAreEqual;
42
+ exports.exec = exec;
43
+ exports.execInherit = execInherit;
44
+ exports.getGitCommit = getGitCommit;
45
+ exports.getGitRemoteUrl = getGitRemoteUrl;
46
+ exports.detectSourceDir = detectSourceDir;
47
+ const fs = __importStar(require("fs"));
48
+ const path = __importStar(require("path"));
49
+ const child_process_1 = require("child_process");
50
+ /**
51
+ * Directories to exclude when copying shared packages.
52
+ */
53
+ const EXCLUDED_DIRS = new Set(['node_modules', 'lib', 'dist', '.heft', 'temp', 'coverage', 'rush-logs']);
54
+ /**
55
+ * Copy a single file, creating parent directories as needed.
56
+ */
57
+ function copyFile(src, dest) {
58
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
59
+ fs.copyFileSync(src, dest);
60
+ }
61
+ /**
62
+ * Copy a directory recursively, excluding build artifacts.
63
+ */
64
+ function copyPackage(src, dest) {
65
+ fs.mkdirSync(dest, { recursive: true });
66
+ fs.cpSync(src, dest, {
67
+ recursive: true,
68
+ filter: (source) => {
69
+ const basename = path.basename(source);
70
+ return !EXCLUDED_DIRS.has(basename);
71
+ }
72
+ });
73
+ }
74
+ /**
75
+ * Compare two files for equality.
76
+ * Returns true if files are identical.
77
+ */
78
+ function filesAreEqual(pathA, pathB) {
79
+ if (!fs.existsSync(pathA) || !fs.existsSync(pathB)) {
80
+ return false;
81
+ }
82
+ const a = fs.readFileSync(pathA);
83
+ const b = fs.readFileSync(pathB);
84
+ return Buffer.compare(a, b) === 0;
85
+ }
86
+ /**
87
+ * Execute a shell command, returning stdout.
88
+ */
89
+ function exec(command, options) {
90
+ const result = (0, child_process_1.execSync)(command, Object.assign({ encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }, options));
91
+ return result.trim();
92
+ }
93
+ /**
94
+ * Execute a shell command, inheriting stdio (output goes to terminal).
95
+ */
96
+ function execInherit(command, options) {
97
+ (0, child_process_1.execSync)(command, Object.assign({ stdio: 'inherit' }, options));
98
+ }
99
+ /**
100
+ * Try to get the current git commit hash from a directory.
101
+ * Returns empty string if not a git repo or git is not available.
102
+ */
103
+ function getGitCommit(dir) {
104
+ try {
105
+ return exec('git rev-parse HEAD', { cwd: dir });
106
+ }
107
+ catch (_a) {
108
+ return '';
109
+ }
110
+ }
111
+ /**
112
+ * Try to get the git remote URL from a directory.
113
+ */
114
+ function getGitRemoteUrl(dir) {
115
+ try {
116
+ return exec('git remote get-url origin', { cwd: dir });
117
+ }
118
+ catch (_a) {
119
+ return 'local';
120
+ }
121
+ }
122
+ /**
123
+ * Auto-detect the fgv source repository root by walking up from a starting directory,
124
+ * looking for a rush.json that belongs to the fgv repo.
125
+ */
126
+ function detectSourceDir(startDir) {
127
+ let dir = path.resolve(startDir);
128
+ const root = path.parse(dir).root;
129
+ while (dir !== root) {
130
+ const rushJsonPath = path.join(dir, 'rush.json');
131
+ if (fs.existsSync(rushJsonPath)) {
132
+ // Verify it looks like the fgv repo by checking for the template tool
133
+ const manifestPath = path.join(dir, 'tools', 'repo-template', 'sync-manifest.json');
134
+ if (fs.existsSync(manifestPath)) {
135
+ return dir;
136
+ }
137
+ }
138
+ dir = path.dirname(dir);
139
+ }
140
+ return undefined;
141
+ }
142
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/fs/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,4BAGC;AAKD,kCASC;AAMD,sCAOC;AAKD,oBAOC;AAKD,kCAKC;AAMD,oCAMC;AAKD,0CAMC;AAMD,0CAgBC;AA7GD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAA0D;AAE1D;;GAEG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;AAEzG;;GAEG;AACH,SAAgB,QAAQ,CAAC,GAAW,EAAE,IAAY;IAChD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,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,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * File system and shell execution helpers.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { execSync, ExecSyncOptions } from 'child_process';\n\n/**\n * Directories to exclude when copying shared packages.\n */\nconst EXCLUDED_DIRS = new Set(['node_modules', 'lib', 'dist', '.heft', 'temp', 'coverage', 'rush-logs']);\n\n/**\n * Copy a single file, creating parent directories as needed.\n */\nexport function copyFile(src: string, dest: string): void {\n fs.mkdirSync(path.dirname(dest), { recursive: true });\n fs.copyFileSync(src, dest);\n}\n\n/**\n * Copy a directory recursively, excluding build artifacts.\n */\nexport function copyPackage(src: string, dest: string): void {\n fs.mkdirSync(dest, { recursive: true });\n fs.cpSync(src, dest, {\n recursive: true,\n filter: (source: string) => {\n const basename = path.basename(source);\n return !EXCLUDED_DIRS.has(basename);\n }\n });\n}\n\n/**\n * Compare two files for equality.\n * Returns true if files are identical.\n */\nexport function filesAreEqual(pathA: string, pathB: string): boolean {\n if (!fs.existsSync(pathA) || !fs.existsSync(pathB)) {\n return false;\n }\n const a = fs.readFileSync(pathA);\n const b = fs.readFileSync(pathB);\n return Buffer.compare(a, b) === 0;\n}\n\n/**\n * Execute a shell command, returning stdout.\n */\nexport function exec(command: string, options?: ExecSyncOptions): string {\n const result = execSync(command, {\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n ...options\n });\n return (result as string).trim();\n}\n\n/**\n * Execute a shell command, inheriting stdio (output goes to terminal).\n */\nexport function execInherit(command: string, options?: ExecSyncOptions): void {\n execSync(command, {\n stdio: 'inherit',\n ...options\n });\n}\n\n/**\n * Try to get the current git commit hash from a directory.\n * Returns empty string if not a git repo or git is not available.\n */\nexport function getGitCommit(dir: string): string {\n try {\n return exec('git rev-parse HEAD', { cwd: dir });\n } catch {\n return '';\n }\n}\n\n/**\n * Try to get the git remote URL from a directory.\n */\nexport function getGitRemoteUrl(dir: string): string {\n try {\n return exec('git remote get-url origin', { cwd: dir });\n } catch {\n return 'local';\n }\n}\n\n/**\n * Auto-detect the fgv source repository root by walking up from a starting directory,\n * looking for a rush.json that belongs to the fgv repo.\n */\nexport function detectSourceDir(startDir: string): string | undefined {\n let dir = path.resolve(startDir);\n const root = path.parse(dir).root;\n\n while (dir !== root) {\n const rushJsonPath = path.join(dir, 'rush.json');\n if (fs.existsSync(rushJsonPath)) {\n // Verify it looks like the fgv repo by checking for the template tool\n const manifestPath = path.join(dir, 'tools', 'repo-template', 'sync-manifest.json');\n if (fs.existsSync(manifestPath)) {\n return dir;\n }\n }\n dir = path.dirname(dir);\n }\n return undefined;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * JSONC patching operations using jsonc-parser.
3
+ * Modifies JSON-with-comments files while preserving all comments and formatting.
4
+ */
5
+ export type PatchOperationType = 'set' | 'set-json' | 'uncomment' | 'add-to-array' | 'remove';
6
+ export interface IPatchOperation {
7
+ type: PatchOperationType;
8
+ path: string;
9
+ value?: unknown;
10
+ }
11
+ /**
12
+ * Parse a value string into a JS value.
13
+ */
14
+ export declare function parseValue(valueStr: string): unknown;
15
+ /**
16
+ * Apply a single patch operation to a JSONC source string.
17
+ */
18
+ export declare function applyOperation(source: string, op: IPatchOperation): string;
19
+ /**
20
+ * Apply a sequence of patch operations to a JSONC source string.
21
+ */
22
+ export declare function applyOperations(source: string, operations: IPatchOperation[]): string;
23
+ /**
24
+ * Read a JSONC file, apply patch operations, and write it back.
25
+ */
26
+ export declare function patchFile(filePath: string, operations: IPatchOperation[]): void;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/jsonc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE9F,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAaD;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAcpD;AAwBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,GAAG,MAAM,CAoC1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,MAAM,CAMrF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,IAAI,CAK/E"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ /**
3
+ * JSONC patching operations using jsonc-parser.
4
+ * Modifies JSON-with-comments files while preserving all comments and formatting.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.parseValue = parseValue;
8
+ exports.applyOperation = applyOperation;
9
+ exports.applyOperations = applyOperations;
10
+ exports.patchFile = patchFile;
11
+ const jsonc_parser_1 = require("jsonc-parser");
12
+ const FORMATTING_OPTIONS = {
13
+ tabSize: 2,
14
+ insertSpaces: true,
15
+ eol: '\n'
16
+ };
17
+ /**
18
+ * Parse a dot-separated path into a JSON path array.
19
+ * Numeric segments are treated as array indices.
20
+ */
21
+ function parsePath(pathStr) {
22
+ return pathStr.split('.').map((seg) => {
23
+ const num = Number(seg);
24
+ return Number.isInteger(num) && num >= 0 ? num : seg;
25
+ });
26
+ }
27
+ /**
28
+ * Parse a value string into a JS value.
29
+ */
30
+ function parseValue(valueStr) {
31
+ if (valueStr === 'true')
32
+ return true;
33
+ if (valueStr === 'false')
34
+ return false;
35
+ if (valueStr === 'null')
36
+ return null;
37
+ const num = Number(valueStr);
38
+ if (!isNaN(num) && valueStr.trim() !== '')
39
+ return num;
40
+ // Strip surrounding quotes if present
41
+ if ((valueStr.startsWith('"') && valueStr.endsWith('"')) ||
42
+ (valueStr.startsWith("'") && valueStr.endsWith("'"))) {
43
+ return valueStr.slice(1, -1);
44
+ }
45
+ return valueStr;
46
+ }
47
+ function escapeRegExp(str) {
48
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
49
+ }
50
+ /**
51
+ * Uncomment a commented-out JSON property in a JSONC string.
52
+ * Handles `// "propertyName": value` patterns.
53
+ */
54
+ function uncommentProperty(source, propertyName) {
55
+ const pattern = new RegExp(`^(\\s*)\\/\\/\\s*("${escapeRegExp(propertyName)}"\\s*:.*)$`, 'm');
56
+ const match = source.match(pattern);
57
+ if (!match) {
58
+ console.warn(` Warning: Could not find commented-out property "${propertyName}" to uncomment`);
59
+ return source;
60
+ }
61
+ const indent = match[1];
62
+ const content = match[2];
63
+ return source.replace(match[0], `${indent}${content}`);
64
+ }
65
+ /**
66
+ * Apply a single patch operation to a JSONC source string.
67
+ */
68
+ function applyOperation(source, op) {
69
+ switch (op.type) {
70
+ case 'set': {
71
+ const jsonPath = parsePath(op.path);
72
+ const edits = (0, jsonc_parser_1.modify)(source, jsonPath, op.value, { formattingOptions: FORMATTING_OPTIONS });
73
+ return (0, jsonc_parser_1.applyEdits)(source, edits);
74
+ }
75
+ case 'set-json': {
76
+ const jsonPath = parsePath(op.path);
77
+ const value = JSON.parse(op.value);
78
+ const edits = (0, jsonc_parser_1.modify)(source, jsonPath, value, { formattingOptions: FORMATTING_OPTIONS });
79
+ return (0, jsonc_parser_1.applyEdits)(source, edits);
80
+ }
81
+ case 'uncomment': {
82
+ // Use the leaf property name for the regex, since nested properties
83
+ // appear as just their leaf name in the file.
84
+ const leafName = op.path.split('.').pop();
85
+ return uncommentProperty(source, leafName);
86
+ }
87
+ case 'add-to-array': {
88
+ const jsonPath = parsePath(op.path);
89
+ const value = JSON.parse(op.value);
90
+ const edits = (0, jsonc_parser_1.modify)(source, [...jsonPath, -1], value, {
91
+ formattingOptions: FORMATTING_OPTIONS,
92
+ isArrayInsertion: true
93
+ });
94
+ return (0, jsonc_parser_1.applyEdits)(source, edits);
95
+ }
96
+ case 'remove': {
97
+ const jsonPath = parsePath(op.path);
98
+ const edits = (0, jsonc_parser_1.modify)(source, jsonPath, undefined, { formattingOptions: FORMATTING_OPTIONS });
99
+ return (0, jsonc_parser_1.applyEdits)(source, edits);
100
+ }
101
+ default:
102
+ throw new Error(`Unknown operation type: ${op.type}`);
103
+ }
104
+ }
105
+ /**
106
+ * Apply a sequence of patch operations to a JSONC source string.
107
+ */
108
+ function applyOperations(source, operations) {
109
+ let result = source;
110
+ for (const op of operations) {
111
+ result = applyOperation(result, op);
112
+ }
113
+ return result;
114
+ }
115
+ /**
116
+ * Read a JSONC file, apply patch operations, and write it back.
117
+ */
118
+ function patchFile(filePath, operations) {
119
+ const fs = require('fs');
120
+ let source = fs.readFileSync(filePath, 'utf-8');
121
+ source = applyOperations(source, operations);
122
+ fs.writeFileSync(filePath, source);
123
+ }
124
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/jsonc/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAgCH,gCAcC;AA2BD,wCAoCC;AAKD,0CAMC;AAKD,8BAKC;AAhID,+CAAkD;AAElD,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,CAAC;IACV,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,IAAI;CACV,CAAC;AAUF;;;GAGG;AACH,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,G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AAO,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC","sourcesContent":["/**\n * JSONC patching operations using jsonc-parser.\n * Modifies JSON-with-comments files while preserving all comments and formatting.\n */\n\nimport { modify, applyEdits } from 'jsonc-parser';\n\nconst FORMATTING_OPTIONS = {\n tabSize: 2,\n insertSpaces: true,\n eol: '\\n'\n};\n\nexport type PatchOperationType = 'set' | 'set-json' | 'uncomment' | 'add-to-array' | 'remove';\n\nexport interface IPatchOperation {\n type: PatchOperationType;\n path: string;\n value?: unknown;\n}\n\n/**\n * Parse a dot-separated path into a JSON path array.\n * Numeric segments are treated as array indices.\n */\nfunction parsePath(pathStr: string): (string | number)[] {\n return pathStr.split('.').map((seg) => {\n const num = Number(seg);\n return Number.isInteger(num) && num >= 0 ? num : seg;\n });\n}\n\n/**\n * Parse a value string into a JS value.\n */\nexport function parseValue(valueStr: string): unknown {\n if (valueStr === 'true') return true;\n if (valueStr === 'false') return false;\n if (valueStr === 'null') return null;\n const num = Number(valueStr);\n if (!isNaN(num) && valueStr.trim() !== '') return num;\n // Strip surrounding quotes if present\n if (\n (valueStr.startsWith('\"') && valueStr.endsWith('\"')) ||\n (valueStr.startsWith(\"'\") && valueStr.endsWith(\"'\"))\n ) {\n return valueStr.slice(1, -1);\n }\n return valueStr;\n}\n\nfunction escapeRegExp(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/**\n * Uncomment a commented-out JSON property in a JSONC string.\n * Handles `// \"propertyName\": value` patterns.\n */\nfunction uncommentProperty(source: string, propertyName: string): string {\n const pattern = new RegExp(`^(\\\\s*)\\\\/\\\\/\\\\s*(\"${escapeRegExp(propertyName)}\"\\\\s*:.*)$`, 'm');\n\n const match = source.match(pattern);\n if (!match) {\n console.warn(` Warning: Could not find commented-out property \"${propertyName}\" to uncomment`);\n return source;\n }\n\n const indent = match[1];\n const content = match[2];\n return source.replace(match[0], `${indent}${content}`);\n}\n\n/**\n * Apply a single patch operation to a JSONC source string.\n */\nexport function applyOperation(source: string, op: IPatchOperation): string {\n switch (op.type) {\n case 'set': {\n const jsonPath = parsePath(op.path);\n const edits = modify(source, jsonPath, op.value, { formattingOptions: FORMATTING_OPTIONS });\n return applyEdits(source, edits);\n }\n case 'set-json': {\n const jsonPath = parsePath(op.path);\n const value = JSON.parse(op.value as string);\n const edits = modify(source, jsonPath, value, { formattingOptions: FORMATTING_OPTIONS });\n return applyEdits(source, edits);\n }\n case 'uncomment': {\n // Use the leaf property name for the regex, since nested properties\n // appear as just their leaf name in the file.\n const leafName = op.path.split('.').pop()!;\n return uncommentProperty(source, leafName);\n }\n case 'add-to-array': {\n const jsonPath = parsePath(op.path);\n const value = JSON.parse(op.value as string);\n const edits = modify(source, [...jsonPath, -1], value, {\n formattingOptions: FORMATTING_OPTIONS,\n isArrayInsertion: true\n });\n return applyEdits(source, edits);\n }\n case 'remove': {\n const jsonPath = parsePath(op.path);\n const edits = modify(source, jsonPath, undefined, { formattingOptions: FORMATTING_OPTIONS });\n return applyEdits(source, edits);\n }\n default:\n throw new Error(`Unknown operation type: ${(op as IPatchOperation).type}`);\n }\n}\n\n/**\n * Apply a sequence of patch operations to a JSONC source string.\n */\nexport function applyOperations(source: string, operations: IPatchOperation[]): string {\n let result = source;\n for (const op of operations) {\n result = applyOperation(result, op);\n }\n return result;\n}\n\n/**\n * Read a JSONC file, apply patch operations, and write it back.\n */\nexport function patchFile(filePath: string, operations: IPatchOperation[]): void {\n const fs = require('fs');\n let source = fs.readFileSync(filePath, 'utf-8');\n source = applyOperations(source, operations);\n fs.writeFileSync(filePath, source);\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Manifest loader — reads and parses sync-manifest.json.
3
+ */
4
+ import { IManifest } from './types';
5
+ export { IManifest, ISharedFile, ISharedPackage, ITemplatedFile } from './types';
6
+ /**
7
+ * Load and parse a sync-manifest.json file.
8
+ */
9
+ export declare function loadManifest(manifestPath: string): IManifest;
10
+ /**
11
+ * Resolve the default manifest path relative to this tool's location.
12
+ * Works whether running from source (src/) or compiled (lib/).
13
+ */
14
+ export declare function getDefaultManifestPath(): string;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/manifest/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjF;;GAEG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAG5D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAM/C"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * Manifest loader — reads and parses sync-manifest.json.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.loadManifest = loadManifest;
40
+ exports.getDefaultManifestPath = getDefaultManifestPath;
41
+ const fs = __importStar(require("fs"));
42
+ const path = __importStar(require("path"));
43
+ /**
44
+ * Load and parse a sync-manifest.json file.
45
+ */
46
+ function loadManifest(manifestPath) {
47
+ const content = fs.readFileSync(manifestPath, 'utf-8');
48
+ return JSON.parse(content);
49
+ }
50
+ /**
51
+ * Resolve the default manifest path relative to this tool's location.
52
+ * Works whether running from source (src/) or compiled (lib/).
53
+ */
54
+ function getDefaultManifestPath() {
55
+ // Walk up from this file to the tool root, then find sync-manifest.json
56
+ // In compiled form: lib/packlets/manifest/index.js → ../../.. → tool root
57
+ // In source form: src/packlets/manifest/index.ts → ../../.. → tool root
58
+ const toolRoot = path.resolve(__dirname, '..', '..', '..');
59
+ return path.join(toolRoot, 'sync-manifest.json');
60
+ }
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/manifest/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWH,oCAGC;AAMD,wDAMC;AAxBD,uCAAyB;AACzB,2CAA6B;AAK7B;;GAEG;AACH,SAAgB,YAAY,CAAC,YAAoB;IAC/C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,wEAAwE;IACxE,0EAA0E;IAC1E,wEAAwE;IACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAC;AACnD,CAAC","sourcesContent":["/**\n * Manifest loader — reads and parses sync-manifest.json.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { IManifest } from './types';\n\nexport { IManifest, ISharedFile, ISharedPackage, ITemplatedFile } from './types';\n\n/**\n * Load and parse a sync-manifest.json file.\n */\nexport function loadManifest(manifestPath: string): IManifest {\n const content = fs.readFileSync(manifestPath, 'utf-8');\n return JSON.parse(content) as IManifest;\n}\n\n/**\n * Resolve the default manifest path relative to this tool's location.\n * Works whether running from source (src/) or compiled (lib/).\n */\nexport function getDefaultManifestPath(): string {\n // Walk up from this file to the tool root, then find sync-manifest.json\n // In compiled form: lib/packlets/manifest/index.js → ../../.. → tool root\n // In source form: src/packlets/manifest/index.ts → ../../.. → tool root\n const toolRoot = path.resolve(__dirname, '..', '..', '..');\n return path.join(toolRoot, 'sync-manifest.json');\n}\n"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Types for the sync-manifest.json file.
3
+ */
4
+ export interface ISharedFile {
5
+ description: string;
6
+ source: string;
7
+ destination: string;
8
+ }
9
+ export interface ISharedPackage {
10
+ description: string;
11
+ source: string;
12
+ destination: string;
13
+ }
14
+ export interface ITemplatedFile {
15
+ description: string;
16
+ template: string;
17
+ destination: string;
18
+ }
19
+ export interface IManifest {
20
+ shared: {
21
+ description: string;
22
+ files: ISharedFile[];
23
+ };
24
+ sharedPackages: {
25
+ description: string;
26
+ packages: ISharedPackage[];
27
+ };
28
+ templated: {
29
+ description: string;
30
+ files: ITemplatedFile[];
31
+ };
32
+ }
33
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/packlets/manifest/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,WAAW,EAAE,CAAC;KACtB,CAAC;IACF,cAAc,EAAE;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,cAAc,EAAE,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,cAAc,EAAE,CAAC;KACzB,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Types for the sync-manifest.json file.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/packlets/manifest/types.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Types for the sync-manifest.json file.\n */\n\nexport interface ISharedFile {\n description: string;\n source: string;\n destination: string;\n}\n\nexport interface ISharedPackage {\n description: string;\n source: string;\n destination: string;\n}\n\nexport interface ITemplatedFile {\n description: string;\n template: string;\n destination: string;\n}\n\nexport interface IManifest {\n shared: {\n description: string;\n files: ISharedFile[];\n };\n sharedPackages: {\n description: string;\n packages: ISharedPackage[];\n };\n templated: {\n description: string;\n files: ITemplatedFile[];\n };\n}\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Template rendering — simple variable substitution for .tmpl files.
3
+ */
4
+ export interface ITemplateVars {
5
+ REPO_URL: string;
6
+ VERSION_POLICY_NAME: string;
7
+ VERSION: string;
8
+ [key: string]: string;
9
+ }
10
+ /**
11
+ * Render a template string by replacing `{{VAR_NAME}}` placeholders.
12
+ */
13
+ export declare function renderTemplate(template: string, vars: ITemplateVars): string;
14
+ /**
15
+ * Read a template file, render it with variables, and write to destination.
16
+ */
17
+ export declare function renderTemplateFile(templatePath: string, destPath: string, vars: ITemplateVars): void;
18
+ /**
19
+ * Resolve the default templates directory relative to this tool's location.
20
+ */
21
+ export declare function getDefaultTemplatesDir(): string;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/template/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,MAAM,CAM5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAWpG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAG/C"}