refactor(modules): one @use path resolution for the CLI and LSP hosts (@gram-lang/modules/node) #309
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!309
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/modules-node-path"
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?
Lot 1b of
.notes/v1.6/plan-finitions-techniques-1.6.md, plus the completion check of lot 1a, which only exists ondev/1.6.⚠️ Merge after #306 (main) and the
main→dev/1.6merge: this branch containsfix/use-path-hardeningmerged in, so its diff includes #306 until then.@gram-lang/modules/node(newexportsentry, like./lint):resolveProjectPath(specifier, fromPath, projectRoot, paths?, path = node:path): the@//@alias// relative resolution and confinement the two hosts used to copy. Pure path arithmetic. Thepathparameter lets the tests run Windows rules on Linux (path.win32: other drive, drive-letter case,..notes).createCliModuleHostcalls it directly; the LSP host wraps it infileURLToPath/pathToFileURL. Case tables moved topackages/modules/tests/node-path.test.ts; each host keeps a wiring test.node:*(playground):@types/nodereferenced innode.tsonly, and a test checks thatnode.tsis the only source file importing anode:module.provideImportExportCompletionscallsvalidateSpecifier()beforehost.resolve(): the@use … as {…}completion never reads a module the graph refuses (./sub\base.gramtest with a file that really exists under that name). Adev/1.6feature, so no changeset.reference/api/modules.mdx(en/fr):validateSpecifierandresolveProjectPath.minorchangeset on@gram-lang/modules.Checks: build, modules / cli / language-server tests, typecheck, lint, conformance,
dedupe:check.