diff --git a/changelog.md b/changelog.md index 2441156..bd858f2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-03-24 - 3.3.1 - fix(config) +switch configuration loading and saving from npmextra.json to smartconfig.json + +- replace the @push.rocks/npmextra dependency with @push.rocks/smartconfig +- update config handling, CLI messaging, and init flow to use smartconfig.json consistently + ## 2026-03-10 - 3.3.0 - feat(server) use UtilityWebsiteServer for dev server, add domain option, update docs, and bump dependencies diff --git a/package.json b/package.json index 0bdd82f..b4b7b98 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@git.zone/tsrun": "^2.0.1", "@push.rocks/early": "^4.0.4", "@push.rocks/lik": "^6.3.1", - "@push.rocks/npmextra": "^5.3.3", + "@push.rocks/smartconfig": "^6.0.0", "@push.rocks/smartcli": "^4.0.20", "@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartexit": "^2.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e88fab..01caa78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,12 +23,12 @@ importers: '@push.rocks/lik': specifier: ^6.3.1 version: 6.3.1 - '@push.rocks/npmextra': - specifier: ^5.3.3 - version: 5.3.3 '@push.rocks/smartcli': specifier: ^4.0.20 version: 4.0.20 + '@push.rocks/smartconfig': + specifier: ^6.0.0 + version: 6.0.0 '@push.rocks/smartdelay': specifier: ^3.0.5 version: 3.0.5 @@ -1114,6 +1114,9 @@ packages: '@push.rocks/smartclickhouse@2.2.0': resolution: {integrity: sha512-eTzKiREIPSzL1kPkVyD6vEbn+WV/DvQqDjP67VlhNlQGbRcemnJG/eLrUUR1ytmdIqnsZGEK6UYBgyj5nhzLNQ==} + '@push.rocks/smartconfig@6.0.0': + resolution: {integrity: sha512-ohXwJdbDXV2budErnZKWBOz01YkjP6gJsZ7QM9+6Wsh+r7O1CVT3JpV+mD8xJWy5tZRHI+3B9L8z0+WkIDtKzw==} + '@push.rocks/smartcrypto@2.0.4': resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==} @@ -6028,6 +6031,23 @@ snapshots: '@push.rocks/smarturl': 3.1.0 '@push.rocks/webrequest': 4.0.5 + '@push.rocks/smartconfig@6.0.0': + dependencies: + '@push.rocks/qenv': 6.1.3 + '@push.rocks/smartfile': 11.2.7 + '@push.rocks/smartjson': 5.2.0 + '@push.rocks/smartlog': 3.2.1 + '@push.rocks/smartpath': 6.0.0 + '@push.rocks/smartpromise': 4.2.3 + '@push.rocks/smartrx': 3.0.10 + '@push.rocks/taskbuffer': 3.5.0 + '@tsclass/tsclass': 9.3.0 + transitivePeerDependencies: + - '@nuxt/kit' + - react + - supports-color + - vue + '@push.rocks/smartcrypto@2.0.4': dependencies: '@push.rocks/smartpromise': 4.2.3 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index ff96ce8..819622c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tswatch', - version: '3.3.0', + version: '3.3.1', description: 'A development tool for automatically watching and re-compiling TypeScript projects upon detecting file changes, enhancing developer workflows.' } diff --git a/ts/tswatch.classes.confighandler.ts b/ts/tswatch.classes.confighandler.ts index c9dab1c..646b6b4 100644 --- a/ts/tswatch.classes.confighandler.ts +++ b/ts/tswatch.classes.confighandler.ts @@ -119,28 +119,28 @@ const presets: Record = { * Handles loading and managing tswatch configuration */ export class ConfigHandler { - private npmextra: plugins.npmextra.Npmextra; + private smartconfig: plugins.smartconfig.Smartconfig; private cwd: string; constructor(cwdArg?: string) { this.cwd = cwdArg || paths.cwd; - this.npmextra = new plugins.npmextra.Npmextra(this.cwd); + this.smartconfig = new plugins.smartconfig.Smartconfig(this.cwd); } /** * Check if a tswatch configuration exists */ public hasConfig(): boolean { - const config = this.npmextra.dataFor(CONFIG_KEY, null); + const config = this.smartconfig.dataFor(CONFIG_KEY, null); return config !== null; } /** - * Load configuration from npmextra.json + * Load configuration from smartconfig.json * If a preset is specified, merge preset defaults with user overrides */ public loadConfig(): interfaces.ITswatchConfig | null { - const config = this.npmextra.dataFor(CONFIG_KEY, null); + const config = this.smartconfig.dataFor(CONFIG_KEY, null); if (!config) { return null; @@ -177,7 +177,7 @@ export class ConfigHandler { } /** - * Get the config key for npmextra.json + * Get the config key for smartconfig.json */ public getConfigKey(): string { return CONFIG_KEY; diff --git a/ts/tswatch.classes.tswatch.ts b/ts/tswatch.classes.tswatch.ts index 7459c67..0524746 100644 --- a/ts/tswatch.classes.tswatch.ts +++ b/ts/tswatch.classes.tswatch.ts @@ -9,7 +9,7 @@ import { logger } from './tswatch.logging.js'; /** * TsWatch - Config-driven file watcher * - * Reads configuration from npmextra.json under the key '@git.zone/tswatch' + * Reads configuration from smartconfig.json under the key '@git.zone/tswatch' * and sets up watchers, bundles, and dev server accordingly. */ export class TsWatch { @@ -27,7 +27,7 @@ export class TsWatch { } /** - * Create TsWatch from npmextra.json configuration + * Create TsWatch from smartconfig.json configuration */ public static fromConfig(cwdArg?: string): TsWatch | null { const configHandler = new ConfigHandler(cwdArg); diff --git a/ts/tswatch.cli.ts b/ts/tswatch.cli.ts index 81e4220..99cbd90 100644 --- a/ts/tswatch.cli.ts +++ b/ts/tswatch.cli.ts @@ -18,7 +18,7 @@ tswatchCli.standardCommand().subscribe(async (argvArg) => { // Config exists - run with it const tsWatch = TsWatch.fromConfig(); if (tsWatch) { - logger.log('info', 'Starting tswatch with configuration from npmextra.json'); + logger.log('info', 'Starting tswatch with configuration from smartconfig.json'); await tsWatch.start(); } else { logger.log('error', 'Failed to load configuration'); @@ -26,7 +26,7 @@ tswatchCli.standardCommand().subscribe(async (argvArg) => { } } else { // No config - launch wizard - logger.log('info', 'No tswatch configuration found in npmextra.json'); + logger.log('info', 'No tswatch configuration found in smartconfig.json'); const config = await runInit(); if (config) { // Run with the newly created config diff --git a/ts/tswatch.init.ts b/ts/tswatch.init.ts index f7407b6..95f6b65 100644 --- a/ts/tswatch.init.ts +++ b/ts/tswatch.init.ts @@ -56,10 +56,10 @@ export class TswatchInit { config = { ...preset, preset: template as interfaces.ITswatchConfig['preset'] }; } - // Save to npmextra.json + // Save to smartconfig.json await this.saveConfig(config); - console.log('\nConfiguration saved to npmextra.json'); + console.log('\nConfiguration saved to smartconfig.json'); console.log('Run "tswatch" to start watching.\n'); return config; @@ -166,16 +166,16 @@ export class TswatchInit { } /** - * Save configuration to npmextra.json + * Save configuration to smartconfig.json */ private async saveConfig(config: interfaces.ITswatchConfig): Promise { - const npmextraPath = plugins.path.join(paths.cwd, 'npmextra.json'); + const smartconfigPath = plugins.path.join(paths.cwd, 'smartconfig.json'); - // Read existing npmextra.json if it exists + // Read existing smartconfig.json if it exists let existingConfig: Record = {}; try { const smartfsInstance = new plugins.smartfs.SmartFs(new plugins.smartfs.SmartFsProviderNode()); - const content = await smartfsInstance.file(npmextraPath).encoding('utf8').read() as string; + const content = await smartfsInstance.file(smartconfigPath).encoding('utf8').read() as string; existingConfig = JSON.parse(content); } catch { // File doesn't exist or is invalid, start fresh @@ -186,7 +186,7 @@ export class TswatchInit { // Write back const smartfsInstance = new plugins.smartfs.SmartFs(new plugins.smartfs.SmartFsProviderNode()); - await smartfsInstance.file(npmextraPath).encoding('utf8').write(JSON.stringify(existingConfig, null, 2)); + await smartfsInstance.file(smartconfigPath).encoding('utf8').write(JSON.stringify(existingConfig, null, 2)); } } diff --git a/ts/tswatch.plugins.ts b/ts/tswatch.plugins.ts index e8ffcc7..28a49e8 100644 --- a/ts/tswatch.plugins.ts +++ b/ts/tswatch.plugins.ts @@ -13,7 +13,7 @@ export { typedserver }; // @push.rocks scope import * as lik from '@push.rocks/lik'; -import * as npmextra from '@push.rocks/npmextra'; +import * as smartconfig from '@push.rocks/smartconfig'; import * as smartcli from '@push.rocks/smartcli'; import * as smartdelay from '@push.rocks/smartdelay'; import * as smartexit from '@push.rocks/smartexit'; @@ -26,7 +26,7 @@ import * as smartwatch from '@push.rocks/smartwatch'; export { lik, - npmextra, + smartconfig, smartcli, smartdelay, smartexit,