fix(config): rename smartconfig metadata file and update config-based compile references

This commit is contained in:
2026-03-24 18:16:56 +00:00
parent 9e288057f4
commit 2bd4acb153
10 changed files with 286 additions and 167 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tsdeno',
version: '1.3.0',
version: '1.3.1',
description: 'A helper tool for deno compile that strips package.json to prevent devDependency bloat in compiled binaries.'
}

View File

@@ -3,13 +3,13 @@ import * as path from 'path';
export { path };
// @push.rocks scope
import * as npmextra from '@push.rocks/smartconfig';
import * as smartconfig from '@push.rocks/smartconfig';
import * as smartcli from '@push.rocks/smartcli';
import { SmartFs, SmartFsProviderNode } from '@push.rocks/smartfs';
import * as smartshell from '@push.rocks/smartshell';
export {
npmextra,
smartconfig,
smartcli,
SmartFs,
SmartFsProviderNode,

View File

@@ -55,22 +55,22 @@ export class TsDeno {
}
/**
* Reads compile targets from npmextra.json and compiles each one.
* Reads compile targets from ..smartconfig.json and compiles each one.
* The package.json hide/restore wraps the entire loop.
*/
public async compileFromConfig(): Promise<void> {
const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd);
const config = npmextraInstance.dataFor<ITsdenoConfig>('@git.zone/tsdeno', {
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.cwd);
const config = smartconfigInstance.dataFor<ITsdenoConfig>('@git.zone/tsdeno', {
compileTargets: [],
});
if (config.compileTargets.length === 0) {
console.error('tsdeno: no compileTargets found in smartconfig.json under "@git.zone/tsdeno"');
console.error('tsdeno: either pass args directly or add config to smartconfig.json');
console.error('tsdeno: no compileTargets found in .smartconfig.json under "@git.zone/tsdeno"');
console.error('tsdeno: either pass args directly or add config to .smartconfig.json');
process.exit(1);
}
console.log(`tsdeno: found ${config.compileTargets.length} compile target(s) in smartconfig.json`);
console.log(`tsdeno: found ${config.compileTargets.length} compile target(s) in .smartconfig.json`);
const packageJsonPath = plugins.path.join(this.cwd, 'package.json');
const backupPath = plugins.path.join(this.cwd, 'package.json.bak');

View File

@@ -10,10 +10,10 @@ tsdenoCli.standardCommand().subscribe(async (argvArg) => {
console.log(`@git.zone/tsdeno v${commitinfo.version}`);
console.log('');
console.log('Usage:');
console.log(' tsdeno compile Compile all targets from smartconfig.json');
console.log(' tsdeno compile Compile all targets from .smartconfig.json');
console.log(' tsdeno compile [deno compile args...] Compile with explicit args (passthrough)');
console.log('');
console.log('When no args are given, tsdeno reads compileTargets from smartconfig.json.');
console.log('When no args are given, tsdeno reads compileTargets from .smartconfig.json.');
console.log('The compile command temporarily removes package.json before running');
console.log('deno compile, preventing devDependencies from bloating the binary.');
console.log('--node-modules-dir=none is added automatically.');
@@ -24,7 +24,7 @@ tsdenoCli.addCommand('compile').subscribe(async (argvArg) => {
const rawArgs = process.argv.slice(3);
if (rawArgs.length === 0) {
// No args — read targets from smartconfig.json
// No args — read targets from .smartconfig.json
await tsDeno.compileFromConfig();
} else {
// Args provided — passthrough to deno compile