Skip to content

Feature/abapgit serialization#9

Merged
ThePlenkov merged 36 commits intomainfrom
feature/abapgit-serialization
Nov 28, 2025
Merged

Feature/abapgit serialization#9
ThePlenkov merged 36 commits intomainfrom
feature/abapgit-serialization

Conversation

@ThePlenkov
Copy link
Copy Markdown
Member

No description provided.

ThePlenkov and others added 30 commits November 9, 2025 20:19
…INN-1667]

- Add lazy loading infrastructure to ADK (LazyContent type, resolveContent, createCachedLazyLoader)
- Enhance ClassHandler and InterfaceHandler with getAdkObject() methods
- Update BaseFormat interface to support serializeAdkObjects() for ADK-based formats
- Modify ImportService to detect and use ADK objects when format supports it
- Add AbapGitPlugin.serializeAdkObjects() wrapper for ADK serialization
- Fix tsdown configuration for proper .d.ts generation
- Add ADT response logging infrastructure (FileLogger, CLI flags)
- Create comprehensive specs: ADK overview, ADK factory, abapGit serialization, ADT logging
- Maintain backward compatibility with legacy ObjectData formats

Architecture:
ADT CLI → ImportService → Handler.getAdkObject() → ADK Object (lazy) → AbapGitSerializer → Files

This implements WS0-WS5 of the ADK architecture alignment plan.
- Added fast-xml-parser for XML parsing capabilities
- Added saxon-js, saxonjs-he, xslt-processor, and xslt3-he for XSLT 3.0 transformations
- Added ajv and ajv-formats for JSON schema validation
- Added jsonata for JSON querying and transformation
- Updated abapify submodule to dirty state (local changes)
chore: mark abapify submodule as dirty (uncommitted changes)
```
chore: update abapify submodule to 9a103d8 (dirty)

- Update abapify submodule reference
- Note: submodule has uncommitted changes (dirty state)
```
chore: mark abapify submodule as dirty
```
chore: mark abapify submodule as dirty
```
- Add nx-sync plugin with nested generator configuration
- Remove @nx/js/typescript plugin (replaced by nx-sync)
- Add nx-sync workspace dependency
- Add sync script guard to prevent root-level sync
- Reorder tsconfig references (abapify root before packages)
- Update abapify submodule to 2e5f873 (dirty state)
chore: add nx-typecheck plugin and configure type checking

- Add nx-typecheck plugin with tsgo and clean options
- Add @typescript/native-preview dependency for faster type checking
- Disable TUI by default in nx.json
- Remove .vscode/ from .gitignore (allow IDE settings)
- Remove obsolete nx-rules files from .gitignore
- Mark abapify submodule as dirty
```
…ute parsing

BREAKING CHANGE: Schema attribute names no longer use @ prefix

## Features

### Response Plugin System
- Add ResponsePlugin interface for intercepting HTTP responses
- Add ResponseContext with raw XML, parsed data, and metadata
- Implement FileStoragePlugin for saving XML/JSON to files
- Implement TransformPlugin for custom data transformations
- Implement LoggingPlugin for request/response logging
- Integrate plugins into adapter with command-level control

### Discovery Command Enhancement
- Add inline capture plugin to discovery command
- Support file extension detection (.xml → XML, .json → JSON)
- Enable command-level plugin configuration

## Fixes

### ts-xml Attribute Parsing
- Remove unnecessary @ prefix from attribute names in schemas
- Simplify parse logic - kind field is sufficient to identify attributes
- Fix attribute extraction bug that caused empty objects

### Schema Type System
- Add optional field support to all field types
- Improve type inference for optional fields
- Clean up schema definitions (remove redundant 'as const')

## Changes

### adt-client-v2
- packages/adt-client-v2/src/plugins.ts: New plugin system
- packages/adt-client-v2/src/adapter.ts: Plugin integration
- packages/adt-client-v2/src/client.ts: Plugin configuration
- packages/adt-client-v2/src/index.ts: Export plugin types
- packages/adt-client-v2/src/adt/discovery/discovery.schema.ts: Remove @ prefix

### ts-xml
- packages/ts-xml/src/types.ts: Add optional field support

### adt-cli
- packages/adt-cli/src/lib/commands/discovery.ts: Use capture plugin

Closes: #discovery-xml-json-storage
…d services namespaces

- Restructure client to expose client.adt.* for low-level contracts
- Add client.services placeholder for future business logic layer
- Implement client.fetch() as utility method for generic requests
- Create session and system information contracts with full type safety
- Add AGENTS.md documentation for contract development patterns
- Implement info and fetch CLI commands using new architecture
- Fix fixtures directory typo (fxitures -> fixtures)
- Organize plugins into separate files with proper exports
- Add session management utilities (cookies, CSRF, session type)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
… CLI command

- Add search contract with quickSearch operation for ABAP object search
- Create ObjectReferencesSchema using proper ts-xml API (kind: 'elems')
- Register search contract in main contract at adt.repository.informationsystem.search
- Migrate CLI search command from v1 to v2 client
- Update AGENTS.md with architecture guidelines and migration status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…plication

- Add getAdtClientV2() utility function in utils/adt-client-v2.ts
- Refactor search, fetch, info, discovery commands to use shared helper
- Remove 73 lines of duplicated auth/client initialization code
- Support optional plugins parameter for advanced use cases (info, discovery)
- Create comprehensive CLI AGENTS.md documentation
- Update adt-client-v2 AGENTS.md with CLI integration guidance

Benefits:
- DRY: Single source of truth for client initialization
- Consistency: Same error messages across all commands
- Maintainability: Changes to auth/client logic in one place
- Simpler commands: Each command now has 15-20 fewer lines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create auth bridge module (utils/auth.ts) to isolate v1 dependency
- Update getAdtClientV2() to use auth bridge instead of importing v1 directly
- Document clean architecture in both CLI and v2 AGENTS.md files

Benefits:
- V2 client remains pure (no file I/O or CLI dependencies)
- Auth management isolated to CLI layer via thin wrapper
- Commands stay framework-agnostic and testable
- Clear separation: CLI handles auth, v2 handles HTTP

Architecture:
Commands → getAdtClientV2() → Auth Bridge → V2 Client
                                  ↓
                          (loads ~/.adt/auth.json)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Logger interface with error() method
- Accept optional logger parameter in getAdtClientV2()
- Replace direct console.error calls with logger
- Default to console.error for backward compatibility

Benefits:
- Commands can inject custom loggers for testing
- No breaking changes (logger is optional)
- Enables mocking error output in tests
- Maintains clean separation of concerns

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Extend Logger interface with optional info() and debug() methods
- Create logging plugin factory that bridges CLI logger to v2 client
- Add enableLogging option to enable HTTP request/response logging
- Automatically inject logging plugin when enableLogging is true

Usage:
```typescript
const client = getAdtClientV2({
  logger: customLogger,
  enableLogging: true  // Enables HTTP logging via plugin
});
```

Benefits:
- CLI logger now propagates to v2 client via plugin system
- Commands can enable detailed HTTP logging for debugging
- Logger interface unified across CLI and client
- No breaking changes (enableLogging defaults to false)

Architecture:
CLI Logger → Logging Plugin → V2 Client HTTP Requests
  ↓
Custom logger interface is respected throughout the stack

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Import Logger interface from @abapify/adt-client (v1)
- Use v2's LoggingPlugin instead of custom implementation
- Implement full v1 Logger interface (trace, debug, info, warn, error, fatal, child)
- Pass logger.info to LoggingPlugin for HTTP request logging

Benefits:
- Unified logger interface across v1 and v2
- Reuses v2's battle-tested LoggingPlugin
- No duplication of logging logic
- Compatible with v1's Pino-based logger

Architecture:
v1 Logger Interface → CLI → v2 LoggingPlugin → HTTP logs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Logger interface to types.ts (pino/winston/bunyan compatible)
- Add optional logger parameter to AdtConnectionConfig
- Export Logger type from main index
- CLI now passes logger to v2 client (not just plugins)

Benefits:
- V2 client can now log internally (errors, debug info, etc.)
- No direct console usage needed in v2 client
- Logger flows through entire stack: CLI → v2 client → adapter
- Compatible with any logger (pino, winston, bunyan, custom)

Architecture:
```
CLI creates logger
  ↓ pass to createAdtClient({ logger })
V2 Client receives logger
  ↓ can use for internal logging
Adapter/SessionManager can use logger
```

Next: Adapter and SessionManager should use the logger

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Logger interface to v2 client types (pino/winston/bunyan compatible)
- Pass logger from CLI to v2 client via AdtConnectionConfig
- Update SessionManager to accept and use logger for session operations
- Update adapter to log HTTP requests, errors, and session events
- Document "NO CONSOLE USAGE" rule in both CLI and v2 client AGENTS.md

This decouples v2 client from direct I/O, making it a pure library that
callers can integrate with any logging framework.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
chore: enable ESM, add puppeteer, and update abapify submodule

- Set package.json type to "module" for ESM support
- Add puppeteer dependency for browser automation
- Remove workspace dependencies from root (nx-sync, nx-tsdown, nx-typecheck, nx-vitest, @abapify/abapgit, @abapify/adt-cli)
- Add tsconfig references for adt-config and adt-puppeteer packages
- Uncomment adt.config.ts in .gitignore (no longer ignored)
- Update abapify submodule to 5d3f566 (dirty state)
- Remove tsconfig.tsbuildinfo
chore: mark abapify submodule as dirty
```
chore: update abapify submodule to a5aa4e9 (dirty state)
```
docs: add package.json best practices to nx-monorepo guide and update abapify submodule

- Document that devDependencies should be hoisted to root package.json
- Explain why npm scripts should be replaced with Nx targets
- Add minimal package.json template showing correct structure
- Include examples of common mistakes (adding tsdown, tsx, typescript as devDeps)
- Show how to define custom commands in project.json instead of package.json scripts
- Update abapify submodule to 5b726f4
```
docs: add package.json best practices to nx-monorepo guide and update abapify submodule

- Document DON'T patterns: no devDependencies or scripts in package.json
- Explain that dev dependencies are hoisted to root
- Show how to use Nx targets instead of npm scripts
- Add minimal package.json example with only metadata and runtime dependencies
- Update abapify submodule to e3f7d21 (dirty state)
```
docs: add package.json best practices to nx-monorepo guide and update abapify submodule

- Add section on avoiding devDependencies in package.json (should be hoisted to root)
- Add section on avoiding npm scripts (use Nx targets instead)
- Add minimal package.json template example with only metadata and runtime dependencies
- Update abapify submodule to d8a5ce2 (dirty state)
```
docs: add package.json best practices to nx-monorepo guide and update abapify submodule

- Document anti-patterns: no devDependencies or scripts in package-level package.json
- Show correct approach: minimal package.json with only metadata and runtime dependencies
- Explain that dev dependencies are hoisted to root and npm scripts should be Nx targets
- Add examples of wrong vs. correct package.json structure
- Update abapify submodule to 8d60f7b (dirty state)
```
ThePlenkov and others added 6 commits November 27, 2025 11:58
- Move schema files to generated/ subfolder for cleaner structure
- Add transport service support in adt-client-v2
- Enhance ts-xsd codegen with new generator architecture
- Update adt-contracts with transport request types
- Improve speci REST inferrable types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
chore: upgrade Nx to v22.2.0-canary, update documentation, and sync abapify submodule

- Update @nx/js and nx from 22.1.0-canary to 22.2.0-canary.20251124-70bbbe9
- Add critical warnings about never modifying submodule working state (stash/checkout/reset) without permission
- Document minimal package.json pattern: no devDependencies or scripts in packages (hoisted to root)
- Add Nx troubleshooting reference to AGENTS.md
- Update migrations.json: remove completed 22.0.0/22.1.0 migrations, add 22.1
chore: upgrade Nx to v22.2.0-canary, update docs, and sync abapify submodule

- Upgrade @nx/js and nx from 22.1.0-canary to 22.2.0-canary.20251124-70bbbe9
- Add package.json best practices to nx-monorepo.md (no devDependencies/scripts in packages)
- Add critical rule to submodules.md: never stash/checkout/reset without permission
- Update AGENTS.md with submodule working state warning and Nx troubleshooting reference
- Update migrations.json: remove completed 22.0.0/22.1.0 migrations, add 22.1
chore: upgrade Nx to v22.2.0-canary, update docs, and sync abapify submodule

- Upgrade @nx/js and nx from 22.1.0-canary to 22.2.0-canary.20251124-70bbbe9
- Add package.json best practices to nx-monorepo.md (no devDependencies/scripts in packages)
- Add critical submodule state modification warning to submodules.md and AGENTS.md
- Never stash/checkout/reset submodule changes without permission (user loses track)
- Add Nx troubleshooting reference to AGENTS.md
- Update migrations.json (remove
…le package.json and build configuration refactoring. Here's the conventional commit message:

refactor(build): migrate all packages to tsdown v0.16.7 with .mjs output

Update all package.json files to use .mjs/.d.mts extensions for ESM output
and standardize build configuration across the monorepo:

- Upgrade tsdown from v0.15.1 to v0.16.7
- Update all package.json main/types/exports to use .mjs/.d.mts extensions
- Consolidate tsdown configs to inherit from base configuration
- Standardize package exports format across all packages
- Add 'obug' v2.1.0 override in e2e/adt-codegen for compatibility
- Enable shims in base tsdown config for better Node.js compatibility

CLI changes:
- Replace deprecated 'transport' command with 'cts' command (alias 'tr')
- Implement server-side filtering for transport search
- Add manual ts-xsd schema for transport find endpoint
- Enhance adt-contracts with CTS transport types and helpers

This improves build consistency and prepares for proper ESM module
resolution across all packages.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
…entional commit message:

refactor(adt-auth): extract browser auth core and add Puppeteer adapter

- Extract shared browser automation logic into @abapify/browser-auth package
- Refactor @abapify/adt-puppeteer to use new adapter pattern
- Add session persistence support via userDataDir option
- Implement silent refresh mechanism for expired sessions
- Add pluginOptions storage in AuthManager for refresh fallback
- Improve login command to support --sid flag for direct auth
- Add refresh command for silent session renewal
- Update auth plugin interface to support optional refresh method
- Add max refresh attempts limit (1) to prevent infinite loops
- Enhance error messages with actionable guidance
- Update documentation with session persistence examples
- Fix pre-commit hook to use npx prefix

Breaking changes:
- PuppeteerAuthOptions moved from local types to browser-auth
- Auth plugin refresh now returns null instead of throwing
- Login flow significantly restructured (config-driven vs manual)
@ThePlenkov ThePlenkov merged commit dfa6542 into main Nov 28, 2025
1 check failed
@ThePlenkov ThePlenkov deleted the feature/abapgit-serialization branch November 28, 2025 19:59
ThePlenkov added a commit that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant