apple / apple/pkl

Package aliases

Open
#353 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
11.5k
Forks
402
Avg merge
1d 15h
Merged PRs (30d)
20

Description

It would be nice if we could alias package imports.

What I do now:

```pkl
amends "package://github.com/aws-cloudformation/rain/releases/download/v1.8.2-alpha1/cloudformation@1.8.2-alpha1#/template.pkl"
import "package://github.com/aws-cloudformation/rain/releases/download/v1.8.2-alpha1/cloudformation@1.8.2-alpha1#/aws/s3/bucket.pkl"

Description = "testing imports"
Resources {
["Foo"] = new {
Type = "AWS::S3::Bucket"
}
["Bar"] = new bucket.Bucket {
BucketName = "my-bucket-name"
}
}
```

What I would like to do:

```pkl
use "package://github.com/aws-cloudformation/rain/releases/download/v1.8.2-alpha1/cloudformation@1.8.2-alpha1" as cfn

amends "cfn/template.pkl"
import "cfn/aws/s3/bucket.pkl"

or

amends cfn.template
import cfn.aws.s3.bucket

...

```

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the parser and resolver for package imports, then compare the proposed `use ... as` syntax with the qualified-name alternative. Done means one defined alias form supports the demonstrated `amends` and `import` examples with corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.