File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ function resolveConfig(config: Config): Context {
4545 config . id ||= config . name ;
4646 config . namespace ||= config . name ;
4747 config . xpiName ||= kebabCase ( config . name ) ;
48- config . build . prefs . prefix ||= `extensions.${ config . namespace } ` ;
48+ // Patch to maintain compatibility for zotero-plugin-template users
49+ config . build . prefs . prefix ||= pkgUser . config . prefsPrefix || `extensions.${ config . namespace } ` ;
4950
5051 // Parse template strings in config
5152 const isPreRelease = version . includes ( "-" ) ;
Original file line number Diff line number Diff line change @@ -280,13 +280,20 @@ export default class Build extends Base {
280280 for ( const match of matchs ) {
281281 const [ matched , key ] = match ;
282282 if ( ! prefsWithoutPrefix [ key ] && ! prefsWithoutPrefix [ key ] ) {
283- this . logger . warn ( `preference key '${ key } ' in ${ path } not init in prefs.js` ) ;
283+ this . logger . warn ( `preference key '${ key } ' in ${ path . replace ( ` ${ dist } /` , "" ) } not init in prefs.js` ) ;
284284 continue ;
285285 }
286- if ( key . startsWith ( prefix ) )
286+ if ( key . startsWith ( prefix ) ) {
287287 continue ;
288- else
288+ }
289+ // else if (key.startsWith("extensions.")) {
290+ // this.logger.warn(`Pref key '${key}' in ${path} starts with 'extensions' but not ${prefix}.`);
291+ // this.logger.debug(`Skip prefixing '${key}' since it starts with 'extensions'.`);
292+ // continue;
293+ // }
294+ else {
289295 content = content . replace ( matched , `preference="${ prefix } .${ key } "` ) ;
296+ }
290297 }
291298 await outputFile ( path , content , "utf-8" ) ;
292299 } ) ) ;
You can’t perform that action at this time.
0 commit comments