fix(config): migrate configuration handling from npmextra to smartconfig

This commit is contained in:
2026-03-24 15:05:07 +00:00
parent 3358a0eacc
commit 470e87eb79
20 changed files with 58 additions and 26 deletions

View File

@@ -6,7 +6,7 @@ export const run = async (projectArg: Project) => {
const gitzoneConfig = await projectArg.gitzoneConfig;
// Get copy configuration from npmextra.json
const npmextraConfig = new plugins.npmextra.Npmextra();
const npmextraConfig = new plugins.npmextra.Smartconfig();
const copyConfig = npmextraConfig.dataFor<any>('gitzone.format.copy', {
patterns: [],
});

View File

@@ -76,7 +76,7 @@ const migrateAccessLevel = (npmextraJson: any): boolean => {
*/
export const run = async (projectArg: Project) => {
const formatSmartstream = new plugins.smartstream.StreamWrapper([
plugins.smartgulp.src([`npmextra.json`]),
plugins.smartgulp.src([`smartconfig.json`]),
gulpFunction.forEach(async (fileArg: plugins.smartfile.SmartFile) => {
const fileString = fileArg.contents.toString();
const npmextraJson = JSON.parse(fileString);

View File

@@ -73,7 +73,7 @@ export const run = async (projectArg: Project) => {
const formatStreamWrapper = new plugins.smartstream.StreamWrapper([
plugins.smartgulp.src([`package.json`]),
gulpFunction.forEach(async (fileArg: plugins.smartfile.SmartFile) => {
const npmextraConfig = new plugins.npmextra.Npmextra(paths.cwd);
const npmextraConfig = new plugins.npmextra.Smartconfig(paths.cwd);
const gitzoneData: any = npmextraConfig.dataFor('@git.zone/cli', {});
const fileString = fileArg.contents.toString();
const packageJson = JSON.parse(fileString);
@@ -149,7 +149,7 @@ export const run = async (projectArg: Project) => {
'dist_ts_web/**/*',
'assets/**/*',
'cli.js',
'npmextra.json',
'smartconfig.json',
'readme.md',
];

View File

@@ -18,7 +18,7 @@ export class CopyFormatter extends BaseFormatter {
const changes: IPlannedChange[] = [];
// Get copy configuration from npmextra.json
const npmextraConfig = new plugins.npmextra.Npmextra();
const npmextraConfig = new plugins.npmextra.Smartconfig();
const copyConfig = npmextraConfig.dataFor<{ patterns: ICopyPattern[] }>(
'gitzone.format.copy',
{ patterns: [] },

View File

@@ -70,7 +70,7 @@ export class NpmextraFormatter extends BaseFormatter {
async analyze(): Promise<IPlannedChange[]> {
const changes: IPlannedChange[] = [];
const npmextraPath = 'npmextra.json';
const npmextraPath = 'smartconfig.json';
// Check if file exists
const exists = await plugins.smartfs.file(npmextraPath).exists();

View File

@@ -101,7 +101,7 @@ export class PackageJsonFormatter extends BaseFormatter {
const packageJson = JSON.parse(currentContent);
// Get gitzone config from npmextra
const npmextraConfig = new plugins.npmextra.Npmextra(paths.cwd);
const npmextraConfig = new plugins.npmextra.Smartconfig(paths.cwd);
const gitzoneData: any = npmextraConfig.dataFor('@git.zone/cli', {});
// Set metadata from gitzone config
@@ -156,7 +156,7 @@ export class PackageJsonFormatter extends BaseFormatter {
'dist_ts_web/**/*',
'assets/**/*',
'cli.js',
'npmextra.json',
'smartconfig.json',
'readme.md',
];

View File

@@ -21,7 +21,7 @@ export class PrettierFormatter extends BaseFormatter {
const rootConfigFiles = [
'package.json',
'tsconfig.json',
'npmextra.json',
'smartconfig.json',
'.prettierrc',
'.prettierrc.json',
'.prettierrc.js',
@@ -232,7 +232,7 @@ export class PrettierFormatter extends BaseFormatter {
private async getPrettierConfig(): Promise<any> {
// Try to load prettier config from the project
const prettierConfig = new plugins.npmextra.Npmextra();
const prettierConfig = new plugins.npmextra.Smartconfig();
return prettierConfig.dataFor('prettier', {
// Default prettier config
singleQuote: true,

View File

@@ -47,7 +47,7 @@ export let run = async (
const planner = new FormatPlanner();
// Get configuration from npmextra
const npmextraConfig = new plugins.npmextra.Npmextra();
const npmextraConfig = new plugins.npmextra.Smartconfig();
const formatConfig = npmextraConfig.dataFor<any>('@git.zone/cli.format', {
interactive: true,
showDiffs: false,

View File

@@ -11,7 +11,7 @@ import * as smartobject from '@push.rocks/smartobject';
import * as smartnpm from '@push.rocks/smartnpm';
import * as smartstream from '@push.rocks/smartstream';
import * as through2 from 'through2';
import * as npmextra from '@push.rocks/npmextra';
import * as npmextra from '@push.rocks/smartconfig';
import * as smartdiff from '@push.rocks/smartdiff';
export {