MCPcopy
hub / github.com/less/less.js / makeFakeRepo

Function makeFakeRepo

scripts/test-release-automation.js:168–193  ·  view source on GitHub ↗
({ packageVersion })

Source from the content-addressed store, hash-verified

166// ---------------------------------------------------------------------------
167
168function makeFakeRepo({ packageVersion }) {
169 const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'less-release-test-'));
170
171 // root package.json (private monorepo root)
172 fs.writeFileSync(
173 path.join(dir, 'package.json'),
174 JSON.stringify({ name: '@less/root', private: true, version: packageVersion }, null, '\t') + '\n',
175 );
176
177 // packages/less/package.json (the publishable package)
178 const pkgDir = path.join(dir, 'packages', 'less');
179 fs.mkdirSync(pkgDir, { recursive: true });
180 fs.writeFileSync(
181 path.join(pkgDir, 'package.json'),
182 JSON.stringify({ name: 'less', version: packageVersion }, null, '\t') + '\n',
183 );
184
185 // Minimal git repo
186 execSync('git init -b master', { cwd: dir, stdio: 'ignore' });
187 execSync('git config user.email "test@test.com"', { cwd: dir, stdio: 'ignore' });
188 execSync('git config user.name "Test"', { cwd: dir, stdio: 'ignore' });
189 execSync('git add .', { cwd: dir, stdio: 'ignore' });
190 execSync('git commit -m "initial"', { cwd: dir, stdio: 'ignore' });
191
192 return dir;
193}
194
195// ---------------------------------------------------------------------------
196// Run bump-and-publish.js in a fake repo

Callers 1

Calls 1

joinMethod · 0.65

Tested by

no test coverage detected