Skip to content

Commit b7a14a3

Browse files
authored
fix: create-app local workflow (#579)
* fix: create-app * changeset
1 parent 0c97fbc commit b7a14a3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.changeset/shaggy-keys-taste.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-rock': patch
3+
---
4+
5+
fix: create-app local workflow

packages/create-app/src/lib/utils/tarball.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function downloadTarballFromNpm(
4242

4343
async function getPackageVersionData(packageName: string, version: string) {
4444
// Fetch package metadata from npm registry
45-
const registryUrl = `https://registry.npmjs.org/${packageName}`;
45+
const registryUrl = `${process.env['NPM_CONFIG_REGISTRY'] || 'https://registry.npmjs.org'}/${packageName}`;
4646
const response = await fetch(registryUrl);
4747

4848
if (!response.ok) {

packages/create-app/src/lib/utils/version.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { logger } from '@rock-js/tools';
66
export function getRockVersion() {
77
try {
88
const __dirname = dirname(fileURLToPath(import.meta.url));
9-
10-
// Note: account for 'dist' folder
11-
const packageJsonPath = join(__dirname, '../../../../package.json');
9+
const packageJsonPath = join(__dirname, '../../package.json');
1210
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
1311
return packageJson.version;
1412
} catch (error) {

0 commit comments

Comments
 (0)