@fgv/repo-template 5.1.0-2 → 5.1.0-21
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/lib/cli.d.ts.map +1 -1
- package/lib/cli.js +44 -3
- package/lib/cli.js.map +1 -1
- package/lib/commands/create.d.ts.map +1 -1
- package/lib/commands/create.js +2 -2
- package/lib/commands/create.js.map +1 -1
- package/lib/commands/init-library.d.ts +13 -0
- package/lib/commands/init-library.d.ts.map +1 -1
- package/lib/commands/init-library.js +52 -0
- package/lib/commands/init-library.js.map +1 -1
- package/lib/commands/link.d.ts +20 -0
- package/lib/commands/link.d.ts.map +1 -0
- package/lib/commands/link.js +273 -0
- package/lib/commands/link.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/package.json +10 -10
- package/.rush/temp/45a8d0dcbb9c2e59fa02645657661dffbd25461f.tar.log +0 -57
- package/.rush/temp/92e27a75687fa5062b71fdb897f0928a8aa4e0c9.tar.log +0 -57
- package/.rush/temp/chunked-rush-logs/repo-template.build.chunks.jsonl +0 -7
- package/.rush/temp/operation/build/all.log +0 -7
- package/.rush/temp/operation/build/log-chunks.jsonl +0 -7
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/shrinkwrap-deps.json +0 -576
- package/config/rig.json +0 -4
- package/rush-logs/repo-template.build.cache.log +0 -4
- package/rush-logs/repo-template.build.log +0 -7
- package/src/cli.ts +0 -141
- package/src/commands/create.ts +0 -216
- package/src/commands/init-library.ts +0 -249
- package/src/commands/patch.ts +0 -84
- package/src/commands/sync.ts +0 -137
- package/src/index.ts +0 -14
- package/src/packlets/fs/index.ts +0 -114
- package/src/packlets/jsonc/index.ts +0 -134
- package/src/packlets/manifest/index.ts +0 -29
- package/src/packlets/manifest/types.ts +0 -36
- package/src/packlets/template/index.ts +0 -48
- package/temp/build/typescript/ts_l9Fw4VUO.json +0 -1
- package/tsconfig.json +0 -7
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Link/unlink/update-fgv-versions commands — automate cross-repo development
|
|
4
|
+
* between fgv and consumer Rush monorepos.
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.runLink = runLink;
|
|
41
|
+
exports.runUnlink = runUnlink;
|
|
42
|
+
exports.runUpdateFgvVersions = runUpdateFgvVersions;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
47
|
+
const jsonc_1 = require("../packlets/jsonc");
|
|
48
|
+
// ── Discovery helpers ──
|
|
49
|
+
/**
|
|
50
|
+
* Read a rush.json and return its project entries.
|
|
51
|
+
*/
|
|
52
|
+
function readRushProjects(rushJsonPath) {
|
|
53
|
+
const content = fs.readFileSync(rushJsonPath, 'utf-8');
|
|
54
|
+
const rush = (0, jsonc_parser_1.parse)(content);
|
|
55
|
+
return rush.projects;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Scan a consumer Rush repo and collect all @fgv/* dependencies (excluding workspace:* entries).
|
|
59
|
+
* Returns a map of packageName -> list of project folders that depend on it.
|
|
60
|
+
*/
|
|
61
|
+
function discoverFgvDeps(repoDir) {
|
|
62
|
+
var _a;
|
|
63
|
+
const rushJsonPath = path.join(repoDir, 'rush.json');
|
|
64
|
+
if (!fs.existsSync(rushJsonPath)) {
|
|
65
|
+
throw new Error(`rush.json not found at ${rushJsonPath}`);
|
|
66
|
+
}
|
|
67
|
+
const projects = readRushProjects(rushJsonPath);
|
|
68
|
+
const deps = new Map();
|
|
69
|
+
for (const project of projects) {
|
|
70
|
+
const pkgJsonPath = path.join(repoDir, project.projectFolder, 'package.json');
|
|
71
|
+
if (!fs.existsSync(pkgJsonPath)) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
75
|
+
const allDeps = Object.assign(Object.assign({}, pkgJson.dependencies), pkgJson.devDependencies);
|
|
76
|
+
for (const [name, spec] of Object.entries(allDeps)) {
|
|
77
|
+
if (name.startsWith('@fgv/') && spec !== 'workspace:*') {
|
|
78
|
+
const existing = (_a = deps.get(name)) !== null && _a !== void 0 ? _a : [];
|
|
79
|
+
existing.push(project.projectFolder);
|
|
80
|
+
deps.set(name, existing);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return deps;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read the fgv worktree's rush.json and build a map of packageName -> projectFolder.
|
|
88
|
+
*/
|
|
89
|
+
function buildFgvPackageMap(fgvDir) {
|
|
90
|
+
const rushJsonPath = path.join(fgvDir, 'rush.json');
|
|
91
|
+
if (!fs.existsSync(rushJsonPath)) {
|
|
92
|
+
throw new Error(`fgv rush.json not found at ${rushJsonPath}`);
|
|
93
|
+
}
|
|
94
|
+
const projects = readRushProjects(rushJsonPath);
|
|
95
|
+
const map = new Map();
|
|
96
|
+
for (const project of projects) {
|
|
97
|
+
map.set(project.packageName, project.projectFolder);
|
|
98
|
+
}
|
|
99
|
+
return map;
|
|
100
|
+
}
|
|
101
|
+
// ── Version helpers ──
|
|
102
|
+
/**
|
|
103
|
+
* Query npm for the latest prerelease version of @fgv/ts-utils and construct a ~X.Y.Z spec.
|
|
104
|
+
*/
|
|
105
|
+
function resolveLatestFgvVersion() {
|
|
106
|
+
var _a;
|
|
107
|
+
const output = (0, child_process_1.execSync)('npm view @fgv/ts-utils dist-tags --json', { encoding: 'utf-8' });
|
|
108
|
+
const tags = JSON.parse(output);
|
|
109
|
+
const version = (_a = tags.alpha) !== null && _a !== void 0 ? _a : tags.latest;
|
|
110
|
+
if (!version) {
|
|
111
|
+
throw new Error('Could not determine latest @fgv version from npm dist-tags');
|
|
112
|
+
}
|
|
113
|
+
return `~${version}`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Update all @fgv/* dependency versions (excluding workspace:*) in a consumer repo's package.json files.
|
|
117
|
+
* Uses jsonc-parser modify() to preserve formatting.
|
|
118
|
+
*/
|
|
119
|
+
function updateVersionsInPackageJsons(repoDir, versionSpec) {
|
|
120
|
+
const rushJsonPath = path.join(repoDir, 'rush.json');
|
|
121
|
+
const projects = readRushProjects(rushJsonPath);
|
|
122
|
+
const changed = [];
|
|
123
|
+
for (const project of projects) {
|
|
124
|
+
const pkgJsonPath = path.join(repoDir, project.projectFolder, 'package.json');
|
|
125
|
+
if (!fs.existsSync(pkgJsonPath)) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));
|
|
129
|
+
const operations = [];
|
|
130
|
+
for (const depField of ['dependencies', 'devDependencies']) {
|
|
131
|
+
const deps = pkgJson[depField];
|
|
132
|
+
if (!deps)
|
|
133
|
+
continue;
|
|
134
|
+
for (const [name, spec] of Object.entries(deps)) {
|
|
135
|
+
if (name.startsWith('@fgv/') && spec !== 'workspace:*') {
|
|
136
|
+
operations.push({
|
|
137
|
+
type: 'set-json',
|
|
138
|
+
path: `${depField}.${name}`,
|
|
139
|
+
value: JSON.stringify(versionSpec)
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (operations.length > 0) {
|
|
145
|
+
(0, jsonc_1.patchFile)(pkgJsonPath, operations);
|
|
146
|
+
changed.push(pkgJsonPath);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return changed;
|
|
150
|
+
}
|
|
151
|
+
// ── Command runners ──
|
|
152
|
+
async function runLink(options) {
|
|
153
|
+
const { fgvDir, repoDir } = options;
|
|
154
|
+
console.log(`==> Linking to local fgv worktree`);
|
|
155
|
+
console.log(` fgv dir: ${fgvDir}`);
|
|
156
|
+
console.log(` repo dir: ${repoDir}`);
|
|
157
|
+
const fgvDeps = discoverFgvDeps(repoDir);
|
|
158
|
+
if (fgvDeps.size === 0) {
|
|
159
|
+
console.log(' No @fgv/* dependencies found in consumer repo.');
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const fgvPackageMap = buildFgvPackageMap(fgvDir);
|
|
163
|
+
// Compute file: overrides relative to common/temp/
|
|
164
|
+
const commonTempDir = path.join(repoDir, 'common', 'temp');
|
|
165
|
+
const overrides = {};
|
|
166
|
+
const warnings = [];
|
|
167
|
+
for (const packageName of fgvDeps.keys()) {
|
|
168
|
+
const projectFolder = fgvPackageMap.get(packageName);
|
|
169
|
+
if (!projectFolder) {
|
|
170
|
+
warnings.push(` Warning: ${packageName} not found in fgv worktree — skipping`);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const absoluteProjectPath = path.join(fgvDir, projectFolder);
|
|
174
|
+
const relativePath = path.relative(commonTempDir, absoluteProjectPath);
|
|
175
|
+
overrides[packageName] = `file:${relativePath}`;
|
|
176
|
+
}
|
|
177
|
+
for (const w of warnings) {
|
|
178
|
+
console.warn(w);
|
|
179
|
+
}
|
|
180
|
+
// Patch pnpm-config.json
|
|
181
|
+
const pnpmConfigPath = path.join(repoDir, 'common', 'config', 'rush', 'pnpm-config.json');
|
|
182
|
+
if (!fs.existsSync(pnpmConfigPath)) {
|
|
183
|
+
throw new Error(`pnpm-config.json not found at ${pnpmConfigPath}`);
|
|
184
|
+
}
|
|
185
|
+
const patchOps = [
|
|
186
|
+
{
|
|
187
|
+
type: 'set-json',
|
|
188
|
+
path: 'globalOverrides',
|
|
189
|
+
value: JSON.stringify(overrides)
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'set',
|
|
193
|
+
path: 'strictPeerDependencies',
|
|
194
|
+
value: false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'set-json',
|
|
198
|
+
path: 'globalPeerDependencyRules',
|
|
199
|
+
value: JSON.stringify({ ignoreMissing: ['mustache'], allowAny: ['@fgv/*'] })
|
|
200
|
+
}
|
|
201
|
+
];
|
|
202
|
+
(0, jsonc_1.patchFile)(pnpmConfigPath, patchOps);
|
|
203
|
+
console.log(`\n Patched: ${pnpmConfigPath}`);
|
|
204
|
+
console.log(` Overrides (${Object.keys(overrides).length} packages):`);
|
|
205
|
+
for (const [name, filePath] of Object.entries(overrides)) {
|
|
206
|
+
console.log(` ${name} -> ${filePath}`);
|
|
207
|
+
}
|
|
208
|
+
console.log(`\n Next: run "rush update --purge" in the consumer repo.`);
|
|
209
|
+
}
|
|
210
|
+
async function runUnlink(options) {
|
|
211
|
+
const { repoDir, version } = options;
|
|
212
|
+
console.log(`==> Unlinking from local fgv worktree`);
|
|
213
|
+
console.log(` repo dir: ${repoDir}`);
|
|
214
|
+
// Restore pnpm-config.json to defaults
|
|
215
|
+
const pnpmConfigPath = path.join(repoDir, 'common', 'config', 'rush', 'pnpm-config.json');
|
|
216
|
+
if (!fs.existsSync(pnpmConfigPath)) {
|
|
217
|
+
throw new Error(`pnpm-config.json not found at ${pnpmConfigPath}`);
|
|
218
|
+
}
|
|
219
|
+
const patchOps = [
|
|
220
|
+
{
|
|
221
|
+
type: 'set-json',
|
|
222
|
+
path: 'globalOverrides',
|
|
223
|
+
value: JSON.stringify({})
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'set',
|
|
227
|
+
path: 'strictPeerDependencies',
|
|
228
|
+
value: true
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: 'set-json',
|
|
232
|
+
path: 'globalPeerDependencyRules',
|
|
233
|
+
value: JSON.stringify({})
|
|
234
|
+
}
|
|
235
|
+
];
|
|
236
|
+
(0, jsonc_1.patchFile)(pnpmConfigPath, patchOps);
|
|
237
|
+
console.log(` Patched: ${pnpmConfigPath} (restored defaults)`);
|
|
238
|
+
// Optionally bump versions
|
|
239
|
+
if (version) {
|
|
240
|
+
console.log(`\n Bumping @fgv/* deps to ${version}...`);
|
|
241
|
+
const changed = updateVersionsInPackageJsons(repoDir, version);
|
|
242
|
+
console.log(` Updated ${changed.length} package.json file(s):`);
|
|
243
|
+
for (const f of changed) {
|
|
244
|
+
console.log(` ${f}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
console.log(`\n Next: run "rush update --purge" in the consumer repo.`);
|
|
248
|
+
}
|
|
249
|
+
async function runUpdateFgvVersions(options) {
|
|
250
|
+
const { repoDir } = options;
|
|
251
|
+
console.log(`==> Updating @fgv/* version specs`);
|
|
252
|
+
console.log(` repo dir: ${repoDir}`);
|
|
253
|
+
// Resolve version
|
|
254
|
+
let versionSpec;
|
|
255
|
+
if (options.version) {
|
|
256
|
+
versionSpec = options.version;
|
|
257
|
+
console.log(` Using explicit version: ${versionSpec}`);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
console.log(' Querying npm for latest version...');
|
|
261
|
+
versionSpec = resolveLatestFgvVersion();
|
|
262
|
+
console.log(` Resolved version: ${versionSpec}`);
|
|
263
|
+
}
|
|
264
|
+
const changed = updateVersionsInPackageJsons(repoDir, versionSpec);
|
|
265
|
+
console.log(`\n Updated ${changed.length} package.json file(s):`);
|
|
266
|
+
for (const f of changed) {
|
|
267
|
+
console.log(` ${f}`);
|
|
268
|
+
}
|
|
269
|
+
if (changed.length > 0) {
|
|
270
|
+
console.log(`\n Next: run "rush update --purge" in the consumer repo.`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/commands/link.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0JH,0BAmEC;AAED,8BA4CC;AAED,oDA0BC;AArSD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAyC;AACzC,+CAAmD;AACnD,6CAA+D;AAwB/D,0BAA0B;AAE1B;;GAEG;AACH,SAAS,gBAAgB,CAAC,YAAoB;IAC5C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC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;IAC3E,CAAC;AACH,CAAC","sourcesContent":["/**\n * Link/unlink/update-fgv-versions commands — automate cross-repo development\n * between fgv and consumer Rush monorepos.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { execSync } from 'child_process';\nimport { parse as parseJsonc } from 'jsonc-parser';\nimport { IPatchOperation, patchFile } from '../packlets/jsonc';\n\n// ── Interfaces ──\n\nexport interface ILinkOptions {\n fgvDir: string;\n repoDir: string;\n}\n\nexport interface IUnlinkOptions {\n repoDir: string;\n version?: string;\n}\n\nexport interface IUpdateFgvVersionsOptions {\n repoDir: string;\n version?: string;\n}\n\ninterface IRushProject {\n packageName: string;\n projectFolder: string;\n}\n\n// ── Discovery helpers ──\n\n/**\n * Read a rush.json and return its project entries.\n */\nfunction readRushProjects(rushJsonPath: string): IRushProject[] {\n const content = fs.readFileSync(rushJsonPath, 'utf-8');\n const rush = parseJsonc(content) as { projects: IRushProject[] };\n return rush.projects;\n}\n\n/**\n * Scan a consumer Rush repo and collect all @fgv/* dependencies (excluding workspace:* entries).\n * Returns a map of packageName -> list of project folders that depend on it.\n */\nfunction discoverFgvDeps(repoDir: string): Map<string, string[]> {\n const rushJsonPath = path.join(repoDir, 'rush.json');\n if (!fs.existsSync(rushJsonPath)) {\n throw new Error(`rush.json not found at ${rushJsonPath}`);\n }\n\n const projects = readRushProjects(rushJsonPath);\n const deps = new Map<string, string[]>();\n\n for (const project of projects) {\n const pkgJsonPath = path.join(repoDir, project.projectFolder, 'package.json');\n if (!fs.existsSync(pkgJsonPath)) {\n continue;\n }\n\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));\n const allDeps: Record<string, string> = {\n ...pkgJson.dependencies,\n ...pkgJson.devDependencies\n };\n\n for (const [name, spec] of Object.entries(allDeps)) {\n if (name.startsWith('@fgv/') && spec !== 'workspace:*') {\n const existing = deps.get(name) ?? [];\n existing.push(project.projectFolder);\n deps.set(name, existing);\n }\n }\n }\n\n return deps;\n}\n\n/**\n * Read the fgv worktree's rush.json and build a map of packageName -> projectFolder.\n */\nfunction buildFgvPackageMap(fgvDir: string): Map<string, string> {\n const rushJsonPath = path.join(fgvDir, 'rush.json');\n if (!fs.existsSync(rushJsonPath)) {\n throw new Error(`fgv rush.json not found at ${rushJsonPath}`);\n }\n\n const projects = readRushProjects(rushJsonPath);\n const map = new Map<string, string>();\n for (const project of projects) {\n map.set(project.packageName, project.projectFolder);\n }\n return map;\n}\n\n// ── Version helpers ──\n\n/**\n * Query npm for the latest prerelease version of @fgv/ts-utils and construct a ~X.Y.Z spec.\n */\nfunction resolveLatestFgvVersion(): string {\n const output = execSync('npm view @fgv/ts-utils dist-tags --json', { encoding: 'utf-8' });\n const tags = JSON.parse(output) as Record<string, string>;\n const version = tags.alpha ?? tags.latest;\n if (!version) {\n throw new Error('Could not determine latest @fgv version from npm dist-tags');\n }\n return `~${version}`;\n}\n\n/**\n * Update all @fgv/* dependency versions (excluding workspace:*) in a consumer repo's package.json files.\n * Uses jsonc-parser modify() to preserve formatting.\n */\nfunction updateVersionsInPackageJsons(repoDir: string, versionSpec: string): string[] {\n const rushJsonPath = path.join(repoDir, 'rush.json');\n const projects = readRushProjects(rushJsonPath);\n const changed: string[] = [];\n\n for (const project of projects) {\n const pkgJsonPath = path.join(repoDir, project.projectFolder, 'package.json');\n if (!fs.existsSync(pkgJsonPath)) {\n continue;\n }\n\n const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8'));\n const operations: IPatchOperation[] = [];\n\n for (const depField of ['dependencies', 'devDependencies'] as const) {\n const deps: Record<string, string> | undefined = pkgJson[depField];\n if (!deps) continue;\n\n for (const [name, spec] of Object.entries(deps)) {\n if (name.startsWith('@fgv/') && spec !== 'workspace:*') {\n operations.push({\n type: 'set-json',\n path: `${depField}.${name}`,\n value: JSON.stringify(versionSpec)\n });\n }\n }\n }\n\n if (operations.length > 0) {\n patchFile(pkgJsonPath, operations);\n changed.push(pkgJsonPath);\n }\n }\n\n return changed;\n}\n\n// ── Command runners ──\n\nexport async function runLink(options: ILinkOptions): Promise<void> {\n const { fgvDir, repoDir } = options;\n\n console.log(`==> Linking to local fgv worktree`);\n console.log(` fgv dir: ${fgvDir}`);\n console.log(` repo dir: ${repoDir}`);\n\n const fgvDeps = discoverFgvDeps(repoDir);\n if (fgvDeps.size === 0) {\n console.log(' No @fgv/* dependencies found in consumer repo.');\n return;\n }\n\n const fgvPackageMap = buildFgvPackageMap(fgvDir);\n\n // Compute file: overrides relative to common/temp/\n const commonTempDir = path.join(repoDir, 'common', 'temp');\n const overrides: Record<string, string> = {};\n const warnings: string[] = [];\n\n for (const packageName of fgvDeps.keys()) {\n const projectFolder = fgvPackageMap.get(packageName);\n if (!projectFolder) {\n warnings.push(` Warning: ${packageName} not found in fgv worktree — skipping`);\n continue;\n }\n const absoluteProjectPath = path.join(fgvDir, projectFolder);\n const relativePath = path.relative(commonTempDir, absoluteProjectPath);\n overrides[packageName] = `file:${relativePath}`;\n }\n\n for (const w of warnings) {\n console.warn(w);\n }\n\n // Patch pnpm-config.json\n const pnpmConfigPath = path.join(repoDir, 'common', 'config', 'rush', 'pnpm-config.json');\n if (!fs.existsSync(pnpmConfigPath)) {\n throw new Error(`pnpm-config.json not found at ${pnpmConfigPath}`);\n }\n\n const patchOps: IPatchOperation[] = [\n {\n type: 'set-json',\n path: 'globalOverrides',\n value: JSON.stringify(overrides)\n },\n {\n type: 'set',\n path: 'strictPeerDependencies',\n value: false\n },\n {\n type: 'set-json',\n path: 'globalPeerDependencyRules',\n value: JSON.stringify({ ignoreMissing: ['mustache'], allowAny: ['@fgv/*'] })\n }\n ];\n\n patchFile(pnpmConfigPath, patchOps);\n\n console.log(`\\n Patched: ${pnpmConfigPath}`);\n console.log(` Overrides (${Object.keys(overrides).length} packages):`);\n for (const [name, filePath] of Object.entries(overrides)) {\n console.log(` ${name} -> ${filePath}`);\n }\n console.log(`\\n Next: run \"rush update --purge\" in the consumer repo.`);\n}\n\nexport async function runUnlink(options: IUnlinkOptions): Promise<void> {\n const { repoDir, version } = options;\n\n console.log(`==> Unlinking from local fgv worktree`);\n console.log(` repo dir: ${repoDir}`);\n\n // Restore pnpm-config.json to defaults\n const pnpmConfigPath = path.join(repoDir, 'common', 'config', 'rush', 'pnpm-config.json');\n if (!fs.existsSync(pnpmConfigPath)) {\n throw new Error(`pnpm-config.json not found at ${pnpmConfigPath}`);\n }\n\n const patchOps: IPatchOperation[] = [\n {\n type: 'set-json',\n path: 'globalOverrides',\n value: JSON.stringify({})\n },\n {\n type: 'set',\n path: 'strictPeerDependencies',\n value: true\n },\n {\n type: 'set-json',\n path: 'globalPeerDependencyRules',\n value: JSON.stringify({})\n }\n ];\n\n patchFile(pnpmConfigPath, patchOps);\n console.log(` Patched: ${pnpmConfigPath} (restored defaults)`);\n\n // Optionally bump versions\n if (version) {\n console.log(`\\n Bumping @fgv/* deps to ${version}...`);\n const changed = updateVersionsInPackageJsons(repoDir, version);\n console.log(` Updated ${changed.length} package.json file(s):`);\n for (const f of changed) {\n console.log(` ${f}`);\n }\n }\n\n console.log(`\\n Next: run \"rush update --purge\" in the consumer repo.`);\n}\n\nexport async function runUpdateFgvVersions(options: IUpdateFgvVersionsOptions): Promise<void> {\n const { repoDir } = options;\n\n console.log(`==> Updating @fgv/* version specs`);\n console.log(` repo dir: ${repoDir}`);\n\n // Resolve version\n let versionSpec: string;\n if (options.version) {\n versionSpec = options.version;\n console.log(` Using explicit version: ${versionSpec}`);\n } else {\n console.log(' Querying npm for latest version...');\n versionSpec = resolveLatestFgvVersion();\n console.log(` Resolved version: ${versionSpec}`);\n }\n\n const changed = updateVersionsInPackageJsons(repoDir, versionSpec);\n console.log(`\\n Updated ${changed.length} package.json file(s):`);\n for (const f of changed) {\n console.log(` ${f}`);\n }\n\n if (changed.length > 0) {\n console.log(`\\n Next: run \"rush update --purge\" in the consumer repo.`);\n }\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { runCreate, ICreateOptions } from './commands/create';
|
|
|
8
8
|
export { runSync, ISyncOptions } from './commands/sync';
|
|
9
9
|
export { runPatch, IPatchOptions, parsePatchArgs } from './commands/patch';
|
|
10
10
|
export { runInitLibrary, IInitLibraryOptions, RigType, CategoryType } from './commands/init-library';
|
|
11
|
+
export { runLink, runUnlink, runUpdateFgvVersions, ILinkOptions, IUnlinkOptions, IUpdateFgvVersionsOptions } from './commands/link';
|
|
11
12
|
export { applyOperations, applyOperation, patchFile, IPatchOperation } from './packlets/jsonc';
|
|
12
13
|
export { loadManifest, IManifest, ISharedFile, ISharedPackage, ITemplatedFile } from './packlets/manifest';
|
|
13
14
|
export { renderTemplate, renderTemplateFile, ITemplateVars } from './packlets/template';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +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"}
|
|
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,EACL,OAAO,EACP,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AACzB,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
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
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;
|
|
8
|
+
exports.renderTemplateFile = exports.renderTemplate = exports.loadManifest = exports.patchFile = exports.applyOperation = exports.applyOperations = exports.runUpdateFgvVersions = exports.runUnlink = exports.runLink = exports.runInitLibrary = exports.parsePatchArgs = exports.runPatch = exports.runSync = exports.runCreate = exports.RepoTemplateCli = void 0;
|
|
9
9
|
var cli_1 = require("./cli");
|
|
10
10
|
Object.defineProperty(exports, "RepoTemplateCli", { enumerable: true, get: function () { return cli_1.RepoTemplateCli; } });
|
|
11
11
|
var create_1 = require("./commands/create");
|
|
@@ -17,6 +17,10 @@ Object.defineProperty(exports, "runPatch", { enumerable: true, get: function ()
|
|
|
17
17
|
Object.defineProperty(exports, "parsePatchArgs", { enumerable: true, get: function () { return patch_1.parsePatchArgs; } });
|
|
18
18
|
var init_library_1 = require("./commands/init-library");
|
|
19
19
|
Object.defineProperty(exports, "runInitLibrary", { enumerable: true, get: function () { return init_library_1.runInitLibrary; } });
|
|
20
|
+
var link_1 = require("./commands/link");
|
|
21
|
+
Object.defineProperty(exports, "runLink", { enumerable: true, get: function () { return link_1.runLink; } });
|
|
22
|
+
Object.defineProperty(exports, "runUnlink", { enumerable: true, get: function () { return link_1.runUnlink; } });
|
|
23
|
+
Object.defineProperty(exports, "runUpdateFgvVersions", { enumerable: true, get: function () { return link_1.runUpdateFgvVersions; } });
|
|
20
24
|
var jsonc_1 = require("./packlets/jsonc");
|
|
21
25
|
Object.defineProperty(exports, "applyOperations", { enumerable: true, get: function () { return jsonc_1.applyOperations; } });
|
|
22
26
|
Object.defineProperty(exports, "applyOperation", { enumerable: true, get: function () { return jsonc_1.applyOperation; } });
|
package/lib/index.js.map
CHANGED
|
@@ -1 +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"]}
|
|
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,wCAOyB;AANvB,+FAAA,OAAO,OAAA;AACP,iGAAA,SAAS,OAAA;AACT,4GAAA,oBAAoB,OAAA;AAKtB,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 {\n runLink,\n runUnlink,\n runUpdateFgvVersions,\n ILinkOptions,\n IUnlinkOptions,\n IUpdateFgvVersionsOptions\n} from './commands/link';\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"]}
|
package/package.json
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fgv/repo-template",
|
|
3
|
-
"version": "5.1.0-
|
|
3
|
+
"version": "5.1.0-21",
|
|
4
4
|
"description": "CLI tool for creating and maintaining fgv-derived Rush monorepos",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"repo-template": "bin/repo-template.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "heft build --clean",
|
|
12
|
-
"test": "heft test --clean",
|
|
13
|
-
"coverage": "heft test --clean --coverage",
|
|
14
|
-
"clean": "heft clean",
|
|
15
|
-
"lint": "eslint src --ext .ts",
|
|
16
|
-
"fixlint": "eslint src --ext .ts --fix"
|
|
17
|
-
},
|
|
18
10
|
"dependencies": {
|
|
19
11
|
"commander": "^11.0.0",
|
|
20
12
|
"jsonc-parser": "~3.3.1"
|
|
@@ -28,5 +20,13 @@
|
|
|
28
20
|
"repository": {
|
|
29
21
|
"type": "git",
|
|
30
22
|
"url": "https://github.com/ErikFortune/fgv.git"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "heft build --clean",
|
|
26
|
+
"test": "heft test --clean",
|
|
27
|
+
"coverage": "heft test --clean --coverage",
|
|
28
|
+
"clean": "heft clean",
|
|
29
|
+
"lint": "eslint src --ext .ts",
|
|
30
|
+
"fixlint": "eslint src --ext .ts --fix"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
Start time: Thu Mar 26 2026 17:16:03 GMT+0100 (Central European Standard Time)
|
|
2
|
-
Invoking "/usr/bin/tar -c -f /Users/erik/Development/projects/fgv/prerelease/common/temp/build-cache/45a8d0dcbb9c2e59fa02645657661dffbd25461f-81ae1cd0b259fc4c.temp -z --files-from=-"
|
|
3
|
-
|
|
4
|
-
======= BEGIN PROCESS INPUT ======
|
|
5
|
-
.rush/temp/operation/build/all.log
|
|
6
|
-
.rush/temp/operation/build/log-chunks.jsonl
|
|
7
|
-
.rush/temp/operation/build/state.json
|
|
8
|
-
lib/cli.d.ts
|
|
9
|
-
lib/cli.d.ts.map
|
|
10
|
-
lib/cli.js
|
|
11
|
-
lib/cli.js.map
|
|
12
|
-
lib/commands/create.d.ts
|
|
13
|
-
lib/commands/create.d.ts.map
|
|
14
|
-
lib/commands/create.js
|
|
15
|
-
lib/commands/create.js.map
|
|
16
|
-
lib/commands/init-library.d.ts
|
|
17
|
-
lib/commands/init-library.d.ts.map
|
|
18
|
-
lib/commands/init-library.js
|
|
19
|
-
lib/commands/init-library.js.map
|
|
20
|
-
lib/commands/patch.d.ts
|
|
21
|
-
lib/commands/patch.d.ts.map
|
|
22
|
-
lib/commands/patch.js
|
|
23
|
-
lib/commands/patch.js.map
|
|
24
|
-
lib/commands/sync.d.ts
|
|
25
|
-
lib/commands/sync.d.ts.map
|
|
26
|
-
lib/commands/sync.js
|
|
27
|
-
lib/commands/sync.js.map
|
|
28
|
-
lib/index.d.ts
|
|
29
|
-
lib/index.d.ts.map
|
|
30
|
-
lib/index.js
|
|
31
|
-
lib/index.js.map
|
|
32
|
-
lib/packlets/fs/index.d.ts
|
|
33
|
-
lib/packlets/fs/index.d.ts.map
|
|
34
|
-
lib/packlets/fs/index.js
|
|
35
|
-
lib/packlets/fs/index.js.map
|
|
36
|
-
lib/packlets/jsonc/index.d.ts
|
|
37
|
-
lib/packlets/jsonc/index.d.ts.map
|
|
38
|
-
lib/packlets/jsonc/index.js
|
|
39
|
-
lib/packlets/jsonc/index.js.map
|
|
40
|
-
lib/packlets/manifest/index.d.ts
|
|
41
|
-
lib/packlets/manifest/index.d.ts.map
|
|
42
|
-
lib/packlets/manifest/index.js
|
|
43
|
-
lib/packlets/manifest/index.js.map
|
|
44
|
-
lib/packlets/manifest/types.d.ts
|
|
45
|
-
lib/packlets/manifest/types.d.ts.map
|
|
46
|
-
lib/packlets/manifest/types.js
|
|
47
|
-
lib/packlets/manifest/types.js.map
|
|
48
|
-
lib/packlets/template/index.d.ts
|
|
49
|
-
lib/packlets/template/index.d.ts.map
|
|
50
|
-
lib/packlets/template/index.js
|
|
51
|
-
lib/packlets/template/index.js.map
|
|
52
|
-
temp/build/typescript/ts_l9Fw4VUO.json
|
|
53
|
-
======== END PROCESS INPUT =======
|
|
54
|
-
======= BEGIN PROCESS OUTPUT =======
|
|
55
|
-
======== END PROCESS OUTPUT ========
|
|
56
|
-
|
|
57
|
-
Exited with code "0"
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
Start time: Thu Mar 26 2026 22:09:06 GMT+0100 (Central European Standard Time)
|
|
2
|
-
Invoking "/usr/bin/tar -c -f /Users/erik/Development/projects/fgv/prerelease/common/temp/build-cache/92e27a75687fa5062b71fdb897f0928a8aa4e0c9-a04acd19552cb8bf.temp -z --files-from=-"
|
|
3
|
-
|
|
4
|
-
======= BEGIN PROCESS INPUT ======
|
|
5
|
-
.rush/temp/operation/build/all.log
|
|
6
|
-
.rush/temp/operation/build/log-chunks.jsonl
|
|
7
|
-
.rush/temp/operation/build/state.json
|
|
8
|
-
lib/cli.d.ts
|
|
9
|
-
lib/cli.d.ts.map
|
|
10
|
-
lib/cli.js
|
|
11
|
-
lib/cli.js.map
|
|
12
|
-
lib/commands/create.d.ts
|
|
13
|
-
lib/commands/create.d.ts.map
|
|
14
|
-
lib/commands/create.js
|
|
15
|
-
lib/commands/create.js.map
|
|
16
|
-
lib/commands/init-library.d.ts
|
|
17
|
-
lib/commands/init-library.d.ts.map
|
|
18
|
-
lib/commands/init-library.js
|
|
19
|
-
lib/commands/init-library.js.map
|
|
20
|
-
lib/commands/patch.d.ts
|
|
21
|
-
lib/commands/patch.d.ts.map
|
|
22
|
-
lib/commands/patch.js
|
|
23
|
-
lib/commands/patch.js.map
|
|
24
|
-
lib/commands/sync.d.ts
|
|
25
|
-
lib/commands/sync.d.ts.map
|
|
26
|
-
lib/commands/sync.js
|
|
27
|
-
lib/commands/sync.js.map
|
|
28
|
-
lib/index.d.ts
|
|
29
|
-
lib/index.d.ts.map
|
|
30
|
-
lib/index.js
|
|
31
|
-
lib/index.js.map
|
|
32
|
-
lib/packlets/fs/index.d.ts
|
|
33
|
-
lib/packlets/fs/index.d.ts.map
|
|
34
|
-
lib/packlets/fs/index.js
|
|
35
|
-
lib/packlets/fs/index.js.map
|
|
36
|
-
lib/packlets/jsonc/index.d.ts
|
|
37
|
-
lib/packlets/jsonc/index.d.ts.map
|
|
38
|
-
lib/packlets/jsonc/index.js
|
|
39
|
-
lib/packlets/jsonc/index.js.map
|
|
40
|
-
lib/packlets/manifest/index.d.ts
|
|
41
|
-
lib/packlets/manifest/index.d.ts.map
|
|
42
|
-
lib/packlets/manifest/index.js
|
|
43
|
-
lib/packlets/manifest/index.js.map
|
|
44
|
-
lib/packlets/manifest/types.d.ts
|
|
45
|
-
lib/packlets/manifest/types.d.ts.map
|
|
46
|
-
lib/packlets/manifest/types.js
|
|
47
|
-
lib/packlets/manifest/types.js.map
|
|
48
|
-
lib/packlets/template/index.d.ts
|
|
49
|
-
lib/packlets/template/index.d.ts.map
|
|
50
|
-
lib/packlets/template/index.js
|
|
51
|
-
lib/packlets/template/index.js.map
|
|
52
|
-
temp/build/typescript/ts_l9Fw4VUO.json
|
|
53
|
-
======== END PROCESS INPUT =======
|
|
54
|
-
======= BEGIN PROCESS OUTPUT =======
|
|
55
|
-
======== END PROCESS OUTPUT ========
|
|
56
|
-
|
|
57
|
-
Exited with code "0"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{"kind":"O","text":"Invoking: heft build --clean \n"}
|
|
2
|
-
{"kind":"O","text":" ---- build started ---- \n"}
|
|
3
|
-
{"kind":"O","text":"[build:clean] Deleted 0 files and 2 folders\n"}
|
|
4
|
-
{"kind":"O","text":"[build:typescript] The TypeScript compiler version 5.9.3 is newer than the latest version that was tested with Heft (5.8); it may not work correctly.\n"}
|
|
5
|
-
{"kind":"O","text":"[build:typescript] Using TypeScript version 5.9.3\n"}
|
|
6
|
-
{"kind":"O","text":" ---- build finished (0.796s) ---- \n"}
|
|
7
|
-
{"kind":"O","text":"-------------------- Finished (0.797s) --------------------\n"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Invoking: heft build --clean
|
|
2
|
-
---- build started ----
|
|
3
|
-
[build:clean] Deleted 0 files and 2 folders
|
|
4
|
-
[build:typescript] The TypeScript compiler version 5.9.3 is newer than the latest version that was tested with Heft (5.8); it may not work correctly.
|
|
5
|
-
[build:typescript] Using TypeScript version 5.9.3
|
|
6
|
-
---- build finished (0.796s) ----
|
|
7
|
-
-------------------- Finished (0.797s) --------------------
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{"kind":"O","text":"Invoking: heft build --clean \n"}
|
|
2
|
-
{"kind":"O","text":" ---- build started ---- \n"}
|
|
3
|
-
{"kind":"O","text":"[build:clean] Deleted 0 files and 2 folders\n"}
|
|
4
|
-
{"kind":"O","text":"[build:typescript] The TypeScript compiler version 5.9.3 is newer than the latest version that was tested with Heft (5.8); it may not work correctly.\n"}
|
|
5
|
-
{"kind":"O","text":"[build:typescript] Using TypeScript version 5.9.3\n"}
|
|
6
|
-
{"kind":"O","text":" ---- build finished (0.796s) ---- \n"}
|
|
7
|
-
{"kind":"O","text":"-------------------- Finished (0.797s) --------------------\n"}
|