fix(config): replace npmextra with smartconfig for base registry resolution
This commit is contained in:
@@ -152,7 +152,7 @@ export class PublishModule {
|
||||
'dist_ts_web/**/*',
|
||||
'assets/**/*',
|
||||
'cli.js',
|
||||
'npmextra.json',
|
||||
'smartconfig.json',
|
||||
'readme.md',
|
||||
],
|
||||
...this.options.tsPublishJson.bin ? {
|
||||
@@ -236,7 +236,7 @@ export class PublishModule {
|
||||
/**
|
||||
* Resolves the registries to publish to based on tspublish.json configuration.
|
||||
* Supports:
|
||||
* - "useBase": Use only registries from npmextra.json
|
||||
* - "useBase": Use only registries from smartconfig.json
|
||||
* - "extendBase": Use base registries + additions, with exclusions via "-" prefix
|
||||
* - Explicit registries: Direct registry URLs in format "url:accessLevel"
|
||||
*/
|
||||
@@ -254,16 +254,16 @@ export class PublishModule {
|
||||
let baseRegistries: string[] = [];
|
||||
let baseAccessLevel = 'public';
|
||||
|
||||
// Load base registries from npmextra.json if needed
|
||||
// Load base registries from smartconfig.json if needed
|
||||
if (hasUseBase || hasExtendBase) {
|
||||
const npmextraInstance = new plugins.npmextra.Npmextra(this.options.monoRepoDir);
|
||||
const gitzoneConfig = npmextraInstance.dataFor<any>('@git.zone/cli', {});
|
||||
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.options.monoRepoDir);
|
||||
const gitzoneConfig = smartconfigInstance.dataFor<any>('@git.zone/cli', {});
|
||||
baseRegistries = gitzoneConfig?.release?.registries || [];
|
||||
baseAccessLevel = gitzoneConfig?.release?.accessLevel || 'public';
|
||||
|
||||
if (baseRegistries.length === 0) {
|
||||
throw new Error(
|
||||
`useBase/extendBase specified in tspublish.json but no registries configured in npmextra.json at @git.zone/cli.release.registries`
|
||||
`useBase/extendBase specified in tspublish.json but no registries configured in smartconfig.json at @git.zone/cli.release.registries`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user