fix: scope Gitea registry to @mosaic packages only (#374)
This commit was merged in pull request #374.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mosaic/cli",
|
"name": "@mosaic/cli",
|
||||||
"version": "0.0.12",
|
"version": "0.0.13",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
|
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
|
||||||
|
|||||||
@@ -211,10 +211,23 @@ const GITEA_REGISTRY = 'https://git.mosaicstack.dev/api/packages/mosaic/npm/';
|
|||||||
|
|
||||||
export function installGatewayPackage(): void {
|
export function installGatewayPackage(): void {
|
||||||
console.log('Installing @mosaic/gateway from Gitea registry...');
|
console.log('Installing @mosaic/gateway from Gitea registry...');
|
||||||
execSync(`npm install -g @mosaic/gateway@latest --registry=${GITEA_REGISTRY}`, {
|
// Scope only @mosaic packages to Gitea; all other deps resolve from npmjs normally
|
||||||
|
const npmrcContent = `@mosaic:registry=${GITEA_REGISTRY}\n`;
|
||||||
|
const tmpNpmrc = join(GATEWAY_HOME, '.npmrc');
|
||||||
|
ensureDirs();
|
||||||
|
writeFileSync(tmpNpmrc, npmrcContent);
|
||||||
|
try {
|
||||||
|
execSync(`npm install -g @mosaic/gateway@latest --userconfig=${tmpNpmrc}`, {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
timeout: 120_000,
|
timeout: 120_000,
|
||||||
});
|
});
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
unlinkSync(tmpNpmrc);
|
||||||
|
} catch {
|
||||||
|
// Ignore cleanup failure
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function uninstallGatewayPackage(): void {
|
export function uninstallGatewayPackage(): void {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mosaic/mosaic",
|
"name": "@mosaic/mosaic",
|
||||||
"version": "0.0.12",
|
"version": "0.0.13",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
|
"url": "https://git.mosaicstack.dev/mosaic/mosaic-stack.git",
|
||||||
|
|||||||
Reference in New Issue
Block a user