refactor(workspace/*): selective imports in 5 files (ADR-025 L2)
Five workspace/ files, 2 stars each -> selective.
workspace/sync.nu:
user/config.nu [get-active-workspace get-workspace-path]
config/accessor DROPPED (dead)
workspace/notation.nu:
user/config.nu [load-user-config]
utils/config DROPPED (dead)
workspace/migration.nu:
user/config.nu [get-workspace-path validate-workspace-exists]
workspace/version.nu [5 symbols — add-migration-record, ...]
workspace/enforcement.nu:
user/config.nu [get-active-workspace get-active-workspace-details]
workspace/version.nu [check-workspace-compatibility validate-workspace-structure]
workspace/detection.nu:
user/config.nu [get-active-workspace]
workspace/notation.nu [get-workspace-path list-workspaces]
— pre-existing name collision: get-workspace-path + list-workspaces
exported by BOTH user/config and notation. Attributed to notation.nu
(consistent with workspace/commands.nu treatment).
Validation: all 5 nu --ide-check 50 -> 0 errors.
Refs: ADR-025
This commit is contained in:
parent
d50fa22d92
commit
f2985043ee
5 changed files with 21 additions and 10 deletions
|
|
@ -1,8 +1,12 @@
|
|||
# Workspace and Infrastructure Detection
|
||||
# Provides PWD-based inference and context management for workspace and infrastructure
|
||||
|
||||
use ../user/config.nu *
|
||||
use notation.nu *
|
||||
# Selective imports (ADR-025 Phase 3 Layer 2).
|
||||
# Name collision: get-workspace-path + list-workspaces exported by both
|
||||
# user/config.nu and workspace/notation.nu. Attribute to notation.nu
|
||||
# (consistent with workspace/commands.nu treatment).
|
||||
use lib_provisioning/user/config.nu [get-active-workspace]
|
||||
use lib_provisioning/workspace/notation.nu [get-workspace-path list-workspaces]
|
||||
|
||||
# Infer workspace from current working directory
|
||||
# Checks if PWD is inside any registered workspace path
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
# Enforces workspace requirements for all provisioning operations
|
||||
|
||||
use std log
|
||||
use ../user/config.nu *
|
||||
use version.nu *
|
||||
# Selective imports (ADR-025 Phase 3 Layer 2).
|
||||
use lib_provisioning/user/config.nu [get-active-workspace get-active-workspace-details]
|
||||
use lib_provisioning/workspace/version.nu [check-workspace-compatibility validate-workspace-structure]
|
||||
|
||||
# Commands that are allowed without an active workspace
|
||||
export def get-workspace-exempt-commands [] {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,12 @@
|
|||
# Handles workspace migrations between versions with backups and rollback
|
||||
|
||||
use std log
|
||||
use ../user/config.nu *
|
||||
use version.nu *
|
||||
# Selective imports (ADR-025 Phase 3 Layer 2).
|
||||
use lib_provisioning/user/config.nu [get-workspace-path validate-workspace-exists]
|
||||
use lib_provisioning/workspace/version.nu [
|
||||
add-migration-record get-system-version get-workspace-metadata-path
|
||||
init-workspace-metadata load-workspace-metadata
|
||||
]
|
||||
|
||||
# Migration strategy definitions
|
||||
export def get-migration-strategies [] {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
# Workspace:Infrastructure Notation Parser
|
||||
# Handles parsing and validation of unified workspace:infra notation
|
||||
|
||||
use ../user/config.nu *
|
||||
use ../utils/config.nu *
|
||||
# Selective imports (ADR-025 Phase 3 Layer 2).
|
||||
# utils/config star-import was dead — dropped.
|
||||
use lib_provisioning/user/config.nu [load-user-config]
|
||||
|
||||
# Parse workspace:infra notation
|
||||
# Supports both "workspace" and "workspace:infra" formats
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
# Workspace sync and update operations
|
||||
# Synchronizes workspace hidden directories with provisioning source
|
||||
|
||||
use ../config/accessor.nu *
|
||||
use ../user/config.nu *
|
||||
# Selective imports (ADR-025 Phase 3 Layer 2).
|
||||
# config/accessor star-import was dead — dropped.
|
||||
use lib_provisioning/user/config.nu [get-active-workspace get-workspace-path]
|
||||
|
||||
# Update all workspace hidden directories and content
|
||||
export def "workspace update" [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue