rename package from @push.rocks/npmextra to @push.rocks/smartconfig

- Rename all source files from npmextra.* to simpler names (classes.appdata.ts, etc.)
- Rename Npmextra class to Smartconfig
- Config file changed from npmextra.json to smartconfig.json
- KV store path changed from ~/.npmextra/kv to ~/.smartconfig/kv
- Update all imports, tests, and metadata
This commit is contained in:
2026-03-24 14:56:23 +00:00
parent fdc2420238
commit 22a9aa9f3e
23 changed files with 202 additions and 363 deletions

View File

@@ -1,5 +1,5 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as npmextra from '../ts/index.js';
import * as smartconfig from '../ts/index.js';
// Test environment variable with boolean false value
tap.test('should handle boolean false values in nested objects correctly', async () => {
@@ -11,7 +11,7 @@ tap.test('should handle boolean false values in nested objects correctly', async
process.env['S3_ACCESSSECRET'] = 'test-secret';
// Create AppData with nested object structure similar to CloudlyConfig
const appData = await npmextra.AppData.createAndInit({
const appData = await smartconfig.AppData.createAndInit({
ephemeral: true, // Use in-memory storage for testing
envMapping: {
s3Descriptor: {
@@ -40,7 +40,7 @@ tap.test('should handle boolean false values in nested objects correctly', async
expect(s3Descriptor.region).toEqual('us-east-1');
expect(s3Descriptor.accessKey).toEqual('test-key');
expect(s3Descriptor.accessSecret).toEqual('test-secret');
// Critical test: useSsl should be false, not undefined
expect(s3Descriptor.useSsl).toEqual(false);
expect(typeof s3Descriptor.useSsl).toEqual('boolean');
@@ -68,8 +68,8 @@ tap.test('should handle various boolean representations correctly', async () =>
for (const testCase of testCases) {
process.env['TEST_BOOL'] = testCase.env;
const appData = await npmextra.AppData.createAndInit({
const appData = await smartconfig.AppData.createAndInit({
ephemeral: true,
envMapping: {
testBool: 'boolean:TEST_BOOL'
@@ -86,7 +86,7 @@ tap.test('should handle various boolean representations correctly', async () =>
tap.test('should handle hardcoded boolean false values', async () => {
// Test with hardcoded boolean false value
const appData = await npmextra.AppData.createAndInit({
const appData = await smartconfig.AppData.createAndInit({
ephemeral: true,
envMapping: {
boolValue: 'hard_boolean:false'
@@ -108,8 +108,8 @@ tap.test('should handle hardcoded boolean false values', async () => {
tap.test('should not filter out other falsy values', async () => {
process.env['ZERO_VALUE'] = '0';
process.env['EMPTY_STRING'] = ''; // This should be preserved as empty string
const appData = await npmextra.AppData.createAndInit({
const appData = await smartconfig.AppData.createAndInit({
ephemeral: true,
envMapping: {
nested: {
@@ -136,4 +136,4 @@ tap.test('should not filter out other falsy values', async () => {
expect(nested.hardcodedZero).toEqual('0');
});
export default tap.start();
export default tap.start();