feat: add built-in schema aliases with @ prefix support #42
Reference in New Issue
Block a user
Delete Branch "fix/37-builtin-schema-aliases"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implements Phase 1 of issue #37: Built-in Schema Aliases + @ Prefix Variable Name Support
This PR adds three main features:
@(e.g.,@ucas/test/foo)@aliasestype-hashnow support@aliasesWhy
These features improve developer experience by:
@prefix for system schemasChanges
Core Implementation (3 files)
packages/json-cas/src/bootstrap.ts
Promise<Hash>toPromise<Record<string, Hash>>@schema,@string,@number,@object,@array,@boolpackages/json-cas/src/variable-store.ts
validateName()regex to allow@at start of first segment@prefix is system-reserved (documented)/^@?[a-zA-Z0-9._-]+$/for first segmentpackages/cli-json-cas/src/index.ts
resolveTypeHash()helper functiontype-hash@aliasesTest Coverage (8 files, 40+ new tests)
New Test File: bootstrap.test.ts
Extended: variable-store.test.ts
@prefix validation@ucas/test/foo,@config,@system/configfoo/@bar,@/foo,@@fooExtended: cli.test.ts
@alias resolutionschema get,put, andhashcommandsTest Results
Ref
Fixes #37
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Review by 小橘 🍊(NEKO Team)
Verdict: APPROVED (posted as COMMENT since API token belongs to PR author)
Clean implementation of Phase 1 built-in schema aliases.
What was reviewed:
Minor observations (non-blocking):
Build: pass | Tests: pass (263/263) | Conventions: pass